开发者

How to disable dojox.grid.DataGrid

开发者 https://www.devze.com 2023-04-09 01:33 出处:网络
H开发者_开发知识库ow can I disable dojox.grid.DataGrid. By disable I mean the whole widget should be disabled and not just some aspect of it (sorting,cell selection etc)You may try with a dojox.widget

H开发者_开发知识库ow can I disable dojox.grid.DataGrid. By disable I mean the whole widget should be disabled and not just some aspect of it (sorting,cell selection etc)


You may try with a dojox.widget.Standby as explained here: Loading indicator with dojo XHR requests . I have never used it on a dojox.grid.DataGrid but it should work...


I think you mean a READ-ONLY grid; In creation of the grid:

 var dataGrid = new  dojox.grid.DataGrid({
                        id: 'xxx',
                        store: myStore, structure:myLayout,
                        canSort:false, //disable sorting //Then do the same thing for every attributes options and disable them all
                        }, dojo.byId("myDivName"));

You might have to override some default behavior such as:

        onHeaderEvent: function (e) {
           //make it do nothing                 

        },

and check on other events from http://livedocs.dojotoolkit.org/dojox/grid/DataGrid just clear everything out.

And in your css, you might have to do such thing like:

.dojoxGridRowSelected
{
    background-color:none;
    border:none;.....
}

.dojoxGridCellFocus 
{
    border:none;
}

Just find the class names from your domNodes


Use attribute "canSort : false" to hide or disable sort button in Dojo DataGrid code

var newGrid = new DataGrid({

    id : 'newGrid',

    canSort:false,

    store : this.resultStore,

    structure : this.resultGridLayout,

    autoHeight:true

});

Regards,

Satish M Hiremath

0

精彩评论

暂无评论...
验证码 换一张
取 消