views:

835

answers:

2

Hi guys 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 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

A: 

I found this demo. However it uses dojo 1.3.

Kniganapolke
A: 

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
        }];
DP