开发者

Select all checkbox in dojo 1.4 grid

开发者 https://www.devze.com 2022-12-17 20:47 出处:网络
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

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

精彩评论

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