how to delete multiple data in datagrid based on a criteria ?
example i have datagrid like this one..

then i want to delete all data that branded '
PANASONIC'..
and this is my code
var rows = $('#table_default').datagrid('getRows');
var rowsLength = rows.length;
for (i = 0; i < rowsLength; i++) {
if (rows[i].BRAND_NAME == 'PANASONIC) {
$('#table_default').datagrid('deleteRow', i);
}
}
but this code is not working properly..
do you know why???
IT'S BECAUSE the table index began to reindex again the table after deleted a data..now i'm stuck to think another way...
NB and FYI :
i don't want to put the code in onLoadSuccess any solution?
thanks in advance..