Provides standard extended selection for grid. Supports mouse/keyboard selection, multi-selection, and de-selection.
Acceptable plugin parameters: The whole plugin parameter object is a config object passed to the setupConfig function.
Acceptable cell parameters defined in layout:
Parameter | Type | Description |
---|---|---|
grid | undefined | |
args | undefined |
Plugin properties - leveraged with default and user specified properties. e.g. for dnd plugin, it may look like {"class": dojox.grid.enhanced.plugins.DnD, "dependency": ["nestedSorting"], ...}
Private properties/methods shouldn't be mixin-ed anytime.
Add to the selection record.
Parameter | Type | Description |
---|---|---|
type | undefined | |
items | undefined |
If some cells are deselected, maybe they have created "holes" in selected rows/cols.
Parameter | Type | Description |
---|---|---|
type | undefined | |
items | undefined |
If some rows/cols are deselected, maybe they have created "holes" in selected cols/rows.
Parameter | Type | Description |
---|---|---|
type | undefined | |
items | undefined |
Record the selected items.
Parameter | Type | Description |
---|---|---|
type | undefined |
Blur the current point.
Parameter | Type | Description |
---|---|---|
type | undefined | |
point | undefined |
Calculate what status should target have. If toSelect is not provided, this is a no op.
Parameter | Type | Description |
---|---|---|
type | undefined | |
target | undefined | |
toHighlight | undefined | |
toSelect | undefined |
Clear selection for given type and fire events, but retain the highlight for reservedItem, thus avoid "flashing".
Parameter | Type | Description |
---|---|---|
type | String | "row", "col", or "cell |
reservedItem | Object | The item to retain highlight. |
End selection. Keep records, fire events and cleanup status.
Parameter | Type | Description |
---|---|---|
type | String | "row", "col", or "cell" |
Parameter | Type | Description |
---|---|---|
evtName | undefined | |
type | undefined |
Focus the current point, so when you move mouse, the focus indicator follows you.
Parameter | Type | Description |
---|---|---|
type | undefined | |
point | undefined |
Go through items from start point to end point.
Parameter | Type | Description |
---|---|---|
type | undefined | |
start | undefined | |
end | undefined | |
func | undefined | |
halfClose | undefined |
Complete the event system of grid, hack some grid functions to prevent default behavior.
Highlight from start point to target.
Parameter | Type | Description |
---|---|---|
type | undefined | |
target | undefined | |
toSelect | Boolean | Whether we are selecting or deselecting. |
Parameter | Type | Description |
---|---|---|
colIdx | undefined | |
toHighlight | undefined |
Do the actual highlight work.
Parameter | Type | Description |
---|---|---|
node | undefined | |
toHighlight | undefined |
Parameter | Type | Description |
---|---|---|
rowIdx | undefined | |
toHighlight | undefined |
Highlight a single item.
Parameter | Type | Description |
---|---|---|
type | undefined | |
toHighlight | undefined | |
target | undefined | |
toSelect | undefined | |
isRefresh | undefined |
Connect events, create event handlers.
Return true only when a cell is covered by selected row/col, and its not a "hole".
Parameter | Type | Description |
---|---|---|
type | undefined | |
item | undefined |
Return true only when the item is in the last seletion/deseletion range.
Parameter | Type | Description |
---|---|---|
type | undefined | |
item | undefined | |
isSelected | undefined |
Return true when the item is selected. (or logically selected, i.e, covered by a row/col).
Parameter | Type | Description |
---|---|---|
type | undefined | |
item | undefined |
Check whether the item is a valid __SelectItem for the given type.
Parameter | Type | Description |
---|---|---|
type | undefined | |
item | undefined | |
allowNotSelectable | undefined |
When some rows/cols are selected, maybe they can cover some of the selected cells, and fill some of the "holes" in the selected cols/rows.
Parameter | Type | Description |
---|---|---|
type | undefined | |
newItems | undefined |
When new cells is selected, maybe they will fill in the "holes" in selected rows and columns.
Parameter | Type | Description |
---|---|---|
type | undefined | |
newCellItems | undefined |
Parameter | Type | Description |
---|---|---|
type | undefined | |
toHighlight | undefined |
Remove from the selection record.
Parameter | Type | Description |
---|---|---|
type | undefined | |
items | undefined |
Start selection, setup start point and current point, fire events.
Parameter | Type | Description |
---|---|---|
type | String | "row", "col", or "cell" |
start | Object | The start point |
extending | Boolean | Whether this is a multi selection |
isRange | Boolean | Whether this is a range selection (i.e. select from the last end point to this point) |
mandatarySelect | Boolean | If true, toSelect will be same as the original selection status. |
toSelect | undefined |
Clear all selections.
Parameter | Type | Description |
---|---|---|
type | String |
Optional "row" or "col" or "cell". If omitted, clear all. |
Connects specified obj/event to specified method of this object.
Parameter | Type | Description |
---|---|---|
obj | undefined | |
event | undefined | |
method | undefined |
var plugin = new dojox.grid.enhanced._Plugin(grid,"myPlugin",{...}); // when foo.bar() is called, call the listener in the scope of plugin plugin.connect(foo, "bar", function(){ console.debug(this.xxx());//"this" - plugin scope });
Parameter | Type | Description |
---|---|---|
type | undefined | |
rowIndex | undefined | |
colIndex | undefined |
Disconnects handle and removes it from connection list.
Parameter | Type | Description |
---|---|---|
handle | undefined |
Get last selected range of the given type.
Parameter | Type | Description |
---|---|---|
type | undefined |
{start: SelectItem, end: SelectItem} return null if nothing is selected.
Get an array of selected locations.
Parameter | Type | Description |
---|---|---|
type | String | "row" or "col" or "cell" |
includeExceptions | Boolean | Only meaningful for rows/columns. If true, all selected rows/cols, even they are partly selected, are all returned. |
Get the number of selected items.
Parameter | Type | Description |
---|---|---|
type | String | "row" or "col" or "cell" |
includeExceptions | Boolean | Only meaningful for rows/columns. If true, all selected rows/cols, even they are partly selected, are all returned. |
The number of selected items.
Get the type of selected items.
"row" or "col" or "cell", or any mix of these (separator is | ).
Check whether a location (a cell, a column or a row) is selected.
Parameter | Type | Description |
---|---|---|
type | String | "row" or "col" or "cell" |
rowIndex | Integer | If type is "row" or "cell", this is the row index. If type if "col", this is the column index. |
colIndex | Integer |
Optional Only valid when type is "cell" |
true if selected, false if not. If cell is covered by a selected column, it's selected.
Check whether the user is currently selecting something.
Parameter | Type | Description |
---|---|---|
type | String | "row" or "col" or "cell" |
true if is selection, false otherwise.
Select a location (a cell, a column or a row).
Parameter | Type | Description |
---|---|---|
type | String | "row" or "col" or "cell" |
rowIndex | Integer | If type is "row" or "cell", this is the row index. If type if "col", this is the column index. |
colIndex | Integer |
Optional Only valid when type is "cell" |
Turn on/off this selection functionality if toEnable is provided. Check whether this selection functionality is enabled if nothing is passed in.
Parameter | Type | Description |
---|---|---|
toEnable | Boolean |
Optional To enable or not. |
Enabled or not.
Select a continuous range (a block of cells, a set of continuous columns or rows)
Parameter | Type | Description |
---|---|---|
type | String | "row" or "col" or "cell" |
start | Integer | Object | If type is "row" or "col", this is the index of the starting row or column. If type if "cell", this is the left-top cell of the range. |
end | Integer | Object | If type is "row" or "col", this is the index of the ending row or column. If type if "cell", this is the right-bottom cell of the range. |
toSelect | undefined |
Set selection mode for row/col/cell.
Parameter | Type | Description |
---|---|---|
config | Object | An object with the following structure (all properties are optional): { //Default is "multi", all other values are same as "multi". row: false|"disabled"|"single", col: false|"disabled"|"single", cell: false|"disabled"|"single" } |
Subscribes to the specified topic and calls the specified method of this object.
Parameter | Type | Description |
---|---|---|
topic | undefined | |
method | undefined |
var plugin = new dojox.grid.enhanced._Plugin(grid,"myPlugin",{...}); // when /my/topic is published, call the subscriber in the scope of plugin // with passed parameter - "v" plugin.subscribe("/my/topic", function(v){ console.debug(this.xxx(v));//"this" - plugin scope });
Parameter | Type | Description |
---|---|---|
type | undefined | |
rowIndex | undefined | |
colIndex | undefined |
Un-subscribes handle and removes it from subscriptions list.
Parameter | Type | Description |
---|---|---|
handle | undefined |
Parameter | Type | Description |
---|---|---|
type | undefined | |
target | undefined |
var plugin = new dojox.grid.enhanced._Plugin(grid,"myPlugin",{...}); // when /my/topic is published, call the subscriber in the scope of plugin // with passed parameter - "v" plugin.subscribe("/my/topic", function(v){ console.debug(this.xxx(v));//"this" - plugin scope });
Parameter | Type | Description |
---|---|---|
type | undefined | |
mapping | undefined |
var plugin = new dojox.grid.enhanced._Plugin(grid,"myPlugin",{...}); // when /my/topic is published, call the subscriber in the scope of plugin // with passed parameter - "v" plugin.subscribe("/my/topic", function(v){ console.debug(this.xxx(v));//"this" - plugin scope });
Parameter | Type | Description |
---|---|---|
id | undefined | |
newIndex | undefined | |
isSelected | undefined |
var plugin = new dojox.grid.enhanced._Plugin(grid,"myPlugin",{...}); // when /my/topic is published, call the subscriber in the scope of plugin // with passed parameter - "v" plugin.subscribe("/my/topic", function(v){ console.debug(this.xxx(v));//"this" - plugin scope });
var plugin = new dojox.grid.enhanced._Plugin(grid,"myPlugin",{...}); // when /my/topic is published, call the subscriber in the scope of plugin // with passed parameter - "v" plugin.subscribe("/my/topic", function(v){ console.debug(this.xxx(v));//"this" - plugin scope });
var plugin = new dojox.grid.enhanced._Plugin(grid,"myPlugin",{...}); // when /my/topic is published, call the subscriber in the scope of plugin // with passed parameter - "v" plugin.subscribe("/my/topic", function(v){ console.debug(this.xxx(v));//"this" - plugin scope });
var plugin = new dojox.grid.enhanced._Plugin(grid,"myPlugin",{...}); // when /my/topic is published, call the subscriber in the scope of plugin // with passed parameter - "v" plugin.subscribe("/my/topic", function(v){ console.debug(this.xxx(v));//"this" - plugin scope });
var plugin = new dojox.grid.enhanced._Plugin(grid,"myPlugin",{...}); // when /my/topic is published, call the subscriber in the scope of plugin // with passed parameter - "v" plugin.subscribe("/my/topic", function(v){ console.debug(this.xxx(v));//"this" - plugin scope });