PDA

View Full Version : Grid Filter's disable "Type ahead" filtering



skmd
11 Nov 2011, 7:40 AM
Hi,

We are using GXT 2.2.5 and IE 8.

We have implemented String, Numeric and List Filters in our project. The Filtering happens on server side. We go the functionality to work as desired.

We would like to disable the type ahead filter functionality and trigger filtering only when the user hits on ENTER key.

I could not find a method that would turn off the type ahead filter functionality. The only option I see is to set the delay using setUpdateBuffer(int) method.

I believe GXT's Combo box provides a method setTypeAhead(boolean) method which does that.

Please let me know if there is a way to disable the type ahead functionality in GXT filters.

Thanks,
Sunil

rherwig
29 Mar 2012, 1:46 PM
Did you ever figure this one out??

I'm attempting to do the same thing. I was not able to simply @Override the onFieldKeyUp() method since the TextField<String> field and DelayTask updateTask are private variables with no getters.

I was able to create my own StringFilter class (just copied the code) and move the call to update.delay() inside the if statement in the onFieldKeyUp() method. This worked.

protected void onFieldKeyUp(FieldEvent fe) {
int key = fe.getKeyCode();
if (key == KeyCodes.KEY_ENTER && field.isValid()) {
fe.stopEvent();
menu.hide(true);
updateTask.delay(getUpdateBuffer());
return;
}
}

Now the user has to press the ENTER key to initiate the filtering.

( seems a pity there are no getters for these variables... :((