Dojo data grid row color change when a cell gets e

2019-09-04 08:45发布

问题:

I need to change the color of my rows in dojo data grid whenever I am editing. I tried dojo.connect, however it works first time after that whenever I hover on other cells its automatically changing the colors of other row.

Does anyone know the solution for this issue?

回答1:

You need to do following

1)CSS changes

.yellowishRow .dojoxGridCell {
    background-color: #F3F781;
}

In your javascript

dojo.connect(dijit.byId("grid"),"onStyleRow",this,function(row){
        var item = dijit.byId("grid").getItem(row.index);
        if (item) {
            var type = store.getValue(item, editMode, null);
                if (type == "1") {
                    row.customClasses += ' regStartedRow';
            }
        dijit.byId("grid").focus.styleRow(row);
        dijit.byId("grid").edit.styleRow(row);

    });