you do not need to loop over the rows ! You can use the "formatter" & the "styles" attribute when defining the layout "galayout"... Take a look at that:
function getExtImg(valueOfColumn) { // Do something with the value... return valueOfColumn+'do something with it'; }
var layout = [[ {'name': 'Ext', 'field': 'extension', formatter: getExtImg, styles:'padding:0px;'},
{'name': 'Filename', 'field': 'documentName', width: 'auto'}]];
// Add this layout to your grid...
What you specify as the formatter function ist called for every row ! Also the style you specify under the styles attribute.
I think this will help you out with your problem !
To be able to change the row style within the formatter, setup a formatter function like this:
formatter:function(val, rowIdx, cell) { classes = compute_classes(val, rowIdx, cell); cell.customClasses.push(classes); }
Source: How do you conditionally style a cell in a Dojo data grid?
As see should easily see, you can add classes to the current row using the push function !
Lucian