开发者

Select all checkbox in dojo 1.4 grid

while migrating from dojo 1.02 to 1.4 i have encountered a problem with grid.

In 1.02 versions i have implemented my own check box class inherriting from dojox.grid._CheckBoxSelector

dojo.provide("MyCheckBox");
dojo.declare("MyCheckBox", dojox.grid._CheckBoxSelector, {

  format: function(inDatum, inRowIndex)
  {
    return '<input class="dojoxGrid-input dojoxGrid-checkbox" type="checkbox"' + 
    (inDatum ? ' checked="checked"' : '') + ' style="width: auto" />' }
  }
}

in layout i pointed editor to开发者_如何学Python this classs

editor:MyCheckBox

and that's about it.

In 1.4 there is no _CheckBoxSelector and i should use enhanced grid with indirectSelection, but there is no option for check all acheckbox in header !!

The only way i know to overcome it is by setting format functions and build a checkbox in it, but i want it to be coupled in grid object.

Thanks in advance


I found this demo. However it uses dojo 1.3.


I have found an answer

when creating layout i have to add CheckBoxSelector like this

view = [[
    {name: 'Column 1', field: 'col1'},
    {name: 'Column 2', field: 'col2'}]]   

var gridCells = [{
            type: "dojox.grid._CheckBoxSelector"
        },
            cells: view
        }];
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜