Hello,
We have a ListGrid with two columns and a filter editor. The filter editor should display a dropdown for both columns but second dropdown depends on the first one.
I have seen a showcase example (Dependent selects) where a ChangeHandler is used on the first SelectItem to set the values of the second SelectItem.
The question is: how can I add that ChangeHandler to the filter editor? I can't find the way to get the items of that filter. (Or is there another solution for my requirement?).
I tried this simple example (without dropdowns, just to try the handlers) but it doesn't work; I suppose it's wrong because I use the ListGridFields and not the filter fields.
Thank you!
Ferran
We have a ListGrid with two columns and a filter editor. The filter editor should display a dropdown for both columns but second dropdown depends on the first one.
I have seen a showcase example (Dependent selects) where a ChangeHandler is used on the first SelectItem to set the values of the second SelectItem.
The question is: how can I add that ChangeHandler to the filter editor? I can't find the way to get the items of that filter. (Or is there another solution for my requirement?).
I tried this simple example (without dropdowns, just to try the handlers) but it doesn't work; I suppose it's wrong because I use the ListGridFields and not the filter fields.
Code:
ListGrid grid = new ListGrid(); grid.setWidth(500); grid.setHeight(200); ListGridField keyField = new ListGridField("key"); keyField.setRequired(true); keyField.addChangedHandler(new ChangedHandler() { @Override public void onChanged(ChangedEvent event) { Log.debug("not called when filter is changed"); } }); keyField.addChangeHandler(new ChangeHandler() { @Override public void onChange(ChangeEvent event) { Log.debug("not called when filter changes"); } }); ListGridField valueField = new ListGridField("value"); valueField.setRequired(true); grid.setFields(keyField, valueField); grid.setShowFilterEditor(true); grid.setCanEdit(true); grid.draw();
Ferran
Comment