PDA

View Full Version : [CLOSED] How to apply multiple query conditions on GridPanel store.



Tarun_Chand
Mar 10, 2013, 9:19 PM
Team,

I want to know the best way to query and find the rows of GridPanel store which satisfy some condition(at client side).

For example: for querying on single column I can use the below statement(which works for querying store on single condition)



store.query("Column_City", "Bangalore").each(
function(rec, index) {
alert('Item found at index:'+index);
});




But how to get the list of rows from store based on querying store based on the data in multiple columns, is there anything available something like the below code.



store.query("Column_City","RED").query("Column_Country","INDIA").each(
function(rec, index) {
alert('Item found at index:'+index);
});

jchau
Mar 10, 2013, 9:59 PM
Store has a queryBy function where you can pass in a function to do whatever you need.

http://docs.sencha.com/ext-js/4-1/#!/api/Ext.data.Store-method-queryBy

Daniil
Mar 11, 2013, 8:58 AM
Hello,

Yes, the queryBy function is what you need.

@jchau, thank you for your attention!