views:

21

answers:

0

Hi, we are using a dojox.grid.DataGrid in a jsp.

<script type="dojo/method" event="onStyleRow" args="inRow">
    var grid = dijit.byId("someID");
    var item = grid.getItem(inRow.index);
    if(item != undefined) {
        if(item.someAttribute == "1") {
            inRow.customClasses = "dojoxGridMYRow";
        } else {
            inRow.customClasses = "dojoxGridRow";
        }
    }     
    if(aBoolean) {
        inRow.customStyles = "backgrund-color: #FFCC00";
    }
    //dojox.grid.DataGrid.prototype.onStyleRow.apply(this, arguments);
    //grid.focus.styleRow(inRow);
    //grid.edit.styleRow(inRow);        
</script>

The first commented line is to get normal behaviour when clicking a row. But it wont change anything until a grid.update() is called, which is not nice, reloading many rows. Its like a flickering. The strange is, if the mouse goes over the changed rows it changes the background color(if no update was called). So it must be possible without a update. Calling updateRow or renderRow oder something like this will cause a infinite loop.

Can anyone help me? :/

Edit: I also tried to copy the behaviour of onStyleRow(cause the selected row is directly marked red), but it makes nothing else than setting customClasses and call this.focus.styleRow(inRow) and this.edit.styleRow(inRow). adding these lines to my function does also take no effect.