dojodojox.grid.datagrid

Dojox DataGrid: achieve row selection only by Checkboxes


I created a DOJO 1.6 DataGrid with CheckboxSelector as shown in the tutorials. Now I want to disable the onSelectionChanged event for rows, if they are clicked. This event should only be fired, if the checkbox is clicked.

How can that be achieved? Is there a constructor property i missed?


Solution

  • You need to override the onRowClick method to not do the selection logic.

    var grid = new dojox.grid.DataGrid({
        store: store,
        structure: layout,
        onRowClick: function(e){
           this.edit.rowClick(e);
           //this.selection.clickSelectEvent(e);
        }
      },
      node
    );
    

    http://jsfiddle.net/cswing/byfaf/