样式Dojox网格行取决于数据

opH*_*AME 6 css grid dojo

我试图根据网格中的值在DojoX(1.2.3)网格中设置一个Row的样式.

网格布局:

var view1 = {
                noscroll: true,
                rows: [{
                    field: 'TASK_ID',
                    name: 'ID',
                    width: '80px',
                    get: this.getColor
                }, {
                    field: 'MENUPOINT',
                    name: 'Action',
                    width: '250px'
                }]
            };
Run Code Online (Sandbox Code Playgroud)

getColor函数:

 getColor: function(inRowIndex) {
        console.log(inRowIndex);
        grid = dijit.byId('gridTaskCurrent');
            // if task_id = 1 style row with other background(?)
        },
Run Code Online (Sandbox Code Playgroud)

我不知道如何从每一行获取task_id值并为行设置样式..如果有人有一个很好的链接或知道如何做...那将是伟大的.

opH*_*AME 10

得到了我自己:

dojo.connect(dijit.byId('gridTaskCurrent'), 'onStyleRow' , this, function(row) {
                   var item = grid.getItem(row.index);

                    if (item) {
                        var type = grid.store.getValue(item, "LOCKED", null);
                        if (type == 1) {
                            row.customStyles += "background-color:limegreen;";
                        }
                    }

                    grid.focus.styleRow(row);
                    grid.edit.styleRow(row);


                });
Run Code Online (Sandbox Code Playgroud)