如何刷新增强的网格?

时间:2017-08-02 07:48:50

标签: javascript dojo dojox.grid.datagrid

我正在使用dojo 1.10增强网格。在加载网格后,我们使用onStyleRow来突出显示网格行和单元格,但问题是我们只有在鼠标悬停网格时才会看到突出显示的单元格。此外,每次我们只在商店中使用颜色更新新行。

我的代码就是这个 -

function rowHighlighting()
{
    dojo.connect(mygrid, 'onStyleRow' , this, function(row){
        var item = mygrid.getItem(row.index);
        if(item){
            var store = mygrid.store;
            var type = store.getValue(item, 'ExceptionFixed',null);

            if(type == '1'){
                 row.customStyles += 'font-weight: bold !important;';

                 var cols = store.getValue(item, 'ExceptionFixedColumns',null);
                 cols = cols.split(",");

                 for(var i=0; i<cols.length;i++){

                     var nd = dojo.query('td[idx="' + i + '"]', row.node)[0];

                     if (cols[i] == "1" && _this.context.options.hideFixesVisibility.get("value") == 'Editable')
                         nd.style.color = "blue";
                     else
                         nd.style.color = "black";
                 }

             }
         }
    });
    //dijit.byId('grid').resize();
   // mygrid.render();
}

在此操作无效后,我尝试手动刷新网格。像这样 -

dijit.byId('grid').resize()

这也是

grid.render()

但它不起作用。那么,我们如何手动执行此操作,因为商店没有反映?

0 个答案:

没有答案
相关问题