Browse Source

Add support for flat JSON to filter-control (#5504)

* Add support for flat JSON to filter-control

Added helper function to get a value from a nested object by a flat json path.

* Fix variable name in getObjectValueByString

* Use existing function from global Utils
Also removed custom function doing the same thing in filter-control.

* Fix code style in utils.js

Co-authored-by: ch1lln <uxmal@abwesend.de>
ch1lln 5 years ago
parent
commit
13ebc7e4a5
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/extensions/filter-control/utils.js

+ 1 - 1
src/extensions/filter-control/utils.js

@@ -248,7 +248,7 @@ export function initFilterSelectControls (that) {
 
       for (let i = 0; i < z; i++) {
         // Added a new value
-        let fieldValue = data[i][field]
+        let fieldValue = Utils.getItemField(data[i], field, false)
         const formatter = that.options.editable && column.editable ? column._formatter : that.header.formatters[j]
         let formattedValue = Utils.calculateObjectValue(that.header, formatter, [fieldValue, data[i], i], fieldValue)