-
Notifications
You must be signed in to change notification settings - Fork 295
selector
Kenneth G. Franqueiro edited this page Jan 29, 2013
·
8 revisions
Used in conjunction with the Selection mixin, the selector plugin dedicates a column to the purpose of rendering a selector component, providing alternate means for selecting and deselecting rows in a grid.
require([
"dojo/_base/declare", "dgrid/OnDemandGrid", "dgrid/Selection", "dgrid/selector"
], function(declare, OnDemandGrid, Selection, selector){
var grid = new (declare([OnDemandGrid, Selection]))({
store: myStore,
selectionMode: "single",
columns: {
col1: selector({ label: "Select", selectorType: "radio" }),
col2: "Column 2"
}
}, "grid");
// ...
});
A selector column can be used to allow selection even in a grid where
selectionMode
is set to none
, in which case the controls in the selector
column will be the only means by which a user may select or deselect rows. Also
note that selector inputs will be disabled for rows for which allowSelect
returns false
.
The selector plugin supports the following additional column definition properties.
Property | Description |
---|---|
selectorType |
Specifies the type of selector component to use. Defaults to "checkbox" , but "radio" may also be specified, as a more appropriate choice for grids in single-selection mode. |
Alternatively, selectorType
may be specified as the second argument to the
selector
function instead of including it within the column definition.