This plugin provides functions to merge(un-merge) adjacent cells within one row. Acceptable plugin parameters:
{ row: function(Integer)|Integer If it's a function, it's a predicate to decide which rows are to be merged. It takes an integer (the row index), and should return true or false; start: Integer The column index of the left most cell that shall be merged. end: Integer The column index of the right most cell that shall be merged. major: Integer The column index of the cell whose content should be used as the content of the merged cell. It must be larger than or equal to the startColumnIndex, and less than or equal to the endColumnIndex. If it is omitted, the content of the leading edge (left-most for ltr, right most for rtl) cell will be used. }
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.
Parameter | Type | Description |
---|---|---|
item | undefined |
Parameter | Type | Description |
---|---|---|
colIndex | undefined |
Parameter | Type | Description |
---|---|---|
item | undefined |
Parameter | Type | Description |
---|---|---|
config | undefined |
Parameter | Type | Description |
---|---|---|
item | undefined |
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 });
Disconnects handle and removes it from connection list.
Parameter | Type | Description |
---|---|---|
handle | undefined |
Get all records of currently merged cells.
An array of records for merged-cells. The record has the following structure:
{ "row": 1, //the row index "start": 2, //the start column index "end": 4, //the end column index "major": 3, //the major column index "handle": someHandle, //The handler that covers this merge cell record. }
Get the records of currently merged cells at the given row.
Parameter | Type | Description |
---|---|---|
rowIndex | undefined |
An array of records for merged-cells. See docs of getMergedCells.
Merge cells from startColumnIndex to endColumnIndex at rows that make rowTester return true, using the content of the cell at majorColumnIndex
Parameter | Type | Description |
---|---|---|
rowTester | undefined | If it's a function, it's a predicate to decide which rows are to be merged. It takes an integer (the row index), and should return true or false; |
startColumnIndex | Integer | The column index of the left most cell that shall be merged. |
endColumnIndex | Integer | The column index of the right most cell that shall be merged. |
majorColumnIndex | Integer |
Optional The column index of the cell whose content should be used as the content of the merged cell. It must be larger than or equal to the startColumnIndex, and less than or equal to the endColumnIndex. If it is omitted, the content of the leading edge (left-most for ltr, right most for rtl) cell will be used. |
A handler for the merged cells created by a call of this function. This handler can be used later to unmerge cells using the function unmergeCells If the merge is not valid, returns null;
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 });
Unmerge the cells that are merged by the mergeHandler, which represents a call to the function mergeCells.
Parameter | Type | Description |
---|---|---|
mergeHandler | object | A handler for the merged cells created by a call of function mergeCells. |
Un-subscribes handle and removes it from subscriptions list.
Parameter | Type | Description |
---|---|---|
handle | undefined |
Parameter | Type | Description |
---|---|---|
viewIdx | undefined | |
rowIndex | undefined | |
subrows | 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 });
Called when store is changed.
Parameter | Type | Description |
---|---|---|
store | 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 });