Search code examples
extjsgriddatastore

how get element from grid


I have grid in extjs program. Grid has 2 columns. I want to get each value in grid. Is possible something like that (of course in JS):

foreach( row in grid ) {
     row.cell[0] // do something 
     row.cell[1] // do something
}

If yes, how to do it?


Solution

  • Using other user answer I know how do it in extjs 3.3.1 (user863680's solution doesn't work in my program).

    gridName.getStore().each(function(rec){  // for each row
    
                            var rowData = rec.data; // get record
                            alert( rowData['col1Name'] ); // get value from cell
                            alert( rowData['col2Name'] );   
    
                        });