Categories | Question details Back To List | ||
Break from grid.forEachRow conditionally I have grid with pagination. If I have each page with 10 rows and total number of rows in the grid is 31. I want to iterate thru each one of the row and get the id of the row which has the hiddenObjValue as Dummy in the UserData. If it is found, I want to break from the loop. Please find the below snippet. This is not working. I have also tried making the loop manually iterating thru each record till grid.getRowsNum(). This throws a javascript error, when it tries to check the data for 11th rows which is not visible on the grid as it goes to the next page. var id=0; Answer posted by Alex (support) on Jan 29, 2010 02:30 Its not possible, you need to iterate by index, to be able to break from the loop var id=0; if(grid.getUserData(grid.getRowId(i),'hiddenObjValue') == 'Dummy') { id = grid.getRowId(i); break; } } |