Get filtered Row ID Part 2


Hello,



You kindly answered a question for me on how to tertive the IDs of all rows after a filter has been done. I can now do this. My further question now is can you return specific calues of these rows. I have a working example where I loop through the resulting array and get each value but this is incredibly slow. ( on a grid with about 900 rows and 20 columns).



This is my code.



var ids=[];
for (var i=0; i<mygrid.getRowsNum(); i++)
   ids.push(mygrid.getRowId(i));



This works fine , then I loop through the ides to get ids and add them to a select list. This all works fine and fast until I add the following line.



cellval=mygrid.cells(ids[i],colid).getValue()



full code for the block is



var elSel = document.getElementById(‘esnlist’);
var colid=mygrid.getColIndexById(“Name”);
 var colid2=mygrid.getColIndexById(“Access Charge No”);
 var cellval;



for (var i = 0; i < ids.length; i++)
   {



var cellval=mygrid.cells(ids[i],colid).getValue()



var elOptNew = document.createElement(‘option’);
         elOptNew.text = ids[i];
         elOptNew.value = ids[i];
         elOptNew.selected = true;
        



         try {
             elSel.add(elOptNew, null); // standards compliant; doesn’t work in IE
           }
           catch(ex) {
             elSel.add(elOptNew); // IE only
           }
   
   
   }



If I comment out the line first line in the loop it flies, when I use it I get messages about slow running scripts in IE7.



Many thanks



Scott Bailey

To get value from the row, it need to be parsed - whcih will remove any performance gained by smart rendering or paging modes.
The next line can be used instead of current one , it must be a lot faster , but it has its own limitation and can’t be used for complex cell types.

for (var i = 0; i < ids.length; i++){
var cellval=mygrid._get_cell_value(mygrid.rowsAr[ids[i]],colid)



Hello,



I am getting the error. Object doesn’t support this property or method. The column I am lookng at is a editable text column.



Scott Bailey

Please check attached sample.
1218791149.zip (84.7 KB)