orpqK
orpqK

Reputation: 2785

Possible to insert some text String into filter text area

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

Answers (1)

Braj
Braj

Reputation: 46841

Steps to follow:

  • Use ListGrid.setShowFilterEditor(true) to show the filter on grid
  • Use 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

Related Questions