View Full Version : store.filter not correct

20 Feb 2009, 9:49 AM
Has anyone run into this one?

I've created a data store in a typical fashion, and use the store on a grid view. So far it's working great. Based on a tree node selection, I initiate a function and in the function I set the store filter.

<gridname>.store.filter('ssid', sID); Where <gridname> is replace with the actual name of the grid.

ssid and sID are of type int

What happens is the filter works, at least to some degree. If there are entries for ssid, as an example, that are 1 and 11, and sID = 1, it displays both, as if it were filtering like

"if ssid contains" .vs. "if ssid equals"

Any help would be appreciated.

20 Feb 2009, 10:23 AM
make your own custom filter, use filterBy

20 Feb 2009, 1:11 PM
Thanks for the reply - but for waht I have - I found an easier method using RegExp, ie

sIDSelect = new RegExp("^"+sID+"$");
<gridname>.store.filter('ssid', sIDSelect);

the store.filter method can take RegExp for the matching string, worked great.