We would like to configure which filters are exposed and/or in which order filters are exposed to the user. Is that already possible or can you add this option to make the filter panel somehow customisable?
Filter configuration is part of the layout, so you can control it by applying the whole layout. Alternatively, you can easily do it by setting the âcolumnNamesâ property, just like that (you can run this code):
let view = grok.shell.addTableView(grok.data.demo.demog());
view.filters({columnNames: ['age']});
Your code snippet works great however the order shown in the filter panel is still different from what was specified in the columNames
option. Is there a way to configure the order in which the filter options are added to the filter panel?
@andreas.gasser.novartis.com This workaround is not perfect (we will definitely improve the way itâs done in the future):
-
Save the layout of a view with the open filter panel (
View | Layout | Download
or programmatically viagrok.shell.v.saveLayout().toJson()
, see details here) -
In JSON, find the filter panel in the âviewStateMapâ and set the order of columns in this field:
"look": { "columnNames": [ "AGE", "DIS_POP", "RACE", "STARTED"] },
-
Apply the layout (if you downloaded it from UI, simply drag-and-drop the modified file back to the view)
The order of columns should be exactly the same, at least it worked for me