PDA

View Full Version : Additional parameters for "each" function in Ext.data.Store?



jeremym
16 Feb 2012, 2:52 PM
When using the "each" method in a Store object, how do I pass in additional parameters? I've got my function defined elsewhere in the same js and using just the record works fine... but I'd like to pass in one or more additional parameters and its not clear how to go about doing so.



myStore.each(somefunct);
...

function somefunct(record){
...
}

that works fine (as expected)... but if I want somefunct to have another parameter its not clear:


function somefunct(record, var2){
...
}

In this case I'm not sure how to define my .each call.

vietits
16 Feb 2012, 3:44 PM
store.each(function(record){
return somefunct(record, value1, value2,...);
});

jeremym
17 Feb 2012, 2:06 PM
worked great, thanks so much!