Reputation: 2785
I have a ListGrid
and above each column of data, there is a filter box. I can manually some text in there and press Filter to filter. How can i insert some text into a filter box with some sort of method in the code? I want to get a filter box above a column, then insert a certain String text in it, so the user can just press the Filter button instead of typing it in themselves.
Upvotes: 0
Views: 364
Reputation: 46841
Steps to follow:
ListGrid.setShowFilterEditor(true)
to show the filter on gridUse ListGridField.setFilterEditorProperties(textItem)
to show the filter on specific column
For example:
TextItem textItem = new TextItem();
// set default value
listGridField.setFilterEditorProperties(textItem);
Use ListGrid.addFilterEditorSubmitHandler()
(if needed) to customize the filter editor submit request.
Follow the SmartGWT showcase - Grid Sort Filter
Upvotes: 0