PDA

View Full Version : Help need with each method of rowSelectionModel



nickweavers
21 Mar 2010, 8:30 AM
Hi,
I'm having trouble understanding how to use this method. The code I wrote is:


var rowIndex = '0';
// iterate through the selection model rows looking for a match on the id_employee value from the form
employeeSelectorGrid.getSelectionModel().each({
fn: function (record) {
if (record.data.id_employee == formObj.findField('id_employee').getValue()) {
// we found a match so select the row
employeeSelectorGrid.getSelectionModel().selectRow(rowIndex);
return true;
}
rowIndex++;
}
});

Firebug tells me:
fn.call is not a function (ext-all-debug.js Line 68036)

Is it possible to use an in-line anonymous function here or must it be a declared function.

TIA,
Nick.

nickweavers
21 Mar 2010, 9:20 AM
Solved.


employeeSelectorGrid.getSelectionModel().each(function(selectMatchedRow) {
if (selectMatchedRow.data.first_name == first_name &&
...