CellSelection
October 20, 2014 ยท View on GitHub
The CellSelection mixin extends upon the functionality of the Selection mixin to provide selection at the cell level instead.
require([
'dojo/_base/declare',
'dgrid/OnDemandGrid',
'dgrid/CellSelection'
], function (declare, OnDemandGrid, CellSelection) {
var grid = new (declare([ OnDemandGrid, CellSelection ]))({
selectionMode: 'single',
// ...
});
});
Differences from Selection mixin
- The
selectionobject stores a nested hash, where the outer hash is keyed by item ID and the inner hashes are keyed by column ID. - The
dgrid-selectanddgrid-deselectevents still fire, but include acellsproperty containing an array of cell objects, rather than arowsproperty. - Whereas Selection's
select,deselect, andisSelectedmethods look up the passed argument via List'srowmethod, CellSelection looks it up via Grid'scellmethod. - The
allowSelectmethod is passed a cell object instead of a row object.