0

I am using GXT's filtered grid(http://www.sencha.com/examples-2/#filtergrid). once the filter is applied i need to remove filtered text whatever user has entered.

enter image description here

is it possible to remove "abc" text programatically without user intervention?

Thanks!

user1016403
  • 12,151
  • 35
  • 108
  • 137

1 Answers1

0

Please try the below code. I have not tested this.

new StringFilter("someValue") {
            @Override
            protected void fireUpdate() {
                super.fireUpdate();
                List<Component> items = menu.getItems();
                if (!items.isEmpty()) {
                    ((Field) items.get(0)).setValue("");
                }
// Not tested this. If the above code is not working try to get the 
textfield instance somehow from the menu and clear it 
            }

        };

If you want to clear the value only on user's key enter and not on programmatic filter (via setValue()), then the above will not work. You have to override the onFieldKeyUp method and clear it using some scheduler.

DonX
  • 16,093
  • 21
  • 75
  • 120