Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by David on Feb 25, 2009 07:02
open dhtmlx forum
getCheckedRows list order

Hello,
i use this
var list = mygrid.getCheckedRows(0);
If i read list i get list id below :
3368,3960,60813

When i look the grid, order is
3960,3820,3368

So how i can get the same order with getCheckedRows ? how order is done?
Answer posted by Support on Feb 25, 2009 08:14
It is not a bug that order of results is not equal to the order of rows. ( forEachRow itterator used , which hasn't fixed order ) 
You can use custom code  as

var max = mygrid.getRowsNum()
var checked=[];
for (var i=0; i<max; i++)
    if (mygrid.cells(i,0).isChecked()) checked.push(mygrid.getRowId(i));