1

I want to change the font color of a row after a cell in that row has been edited and set to a certain value. myStore is the dojo.data.ItemFileWriteStore associated to the dojox.grid.DataGrid dataGrid.

I have written this:

myStore.onSet = function(item, attribute, oldValue, newValue) { 
    if (item.myField == myValue) {
        var index = dataGrid.selection.selectedIndex;
        dojo.style(dataGrid.getRowNode(index), "color" , "red");
    }
}

but unfortunately this doesn't make any effect...

UPDATE: I added the following style property: "backgroundColor" : "red". Well, the background color of the row changes to red, but when the mouse moves away from the row, the color changes back to the default! It might be that some default event handlers restore the default styles...

1 Answer 1

0

The dojo.style line works if you call it by itself. Either your function isn't being called at all, the if's condition false or there is no row selected and you are getting an invalid number for the index. (You can put some console.logs there to check)

1
  • mmm... the index is logged correctly, and also the RowNode object. But probably dojo.style is not supposed to work in this way. What else would you try?
    – perissf
    Jul 30, 2011 at 6:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.