forked from dojo/dojo1-dgrid
-
Notifications
You must be signed in to change notification settings - Fork 1
CellSelection
Kenneth G. Franqueiro edited this page Jan 30, 2013
·
4 revisions
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 = declare([OnDemandGrid, CellSelection])({
selectionMode: "single",
// ...
});
});- 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.