Constructor
new mw.widgets.RowWidgetModel([config])
#
Create an instance of mw.widgets.RowWidgetModel
.
Parameters:
Name | Type | Attributes | Description | |||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
config |
Object |
optional |
Configuration options Properties:
|
- Mixes in:
- Source:
Methods
clear()
#
Clears the row data.
Fires:
clearWithProperties()
#
Clears the row data, as well as all cell properties.
Fires:
getAllCellProperties() → {Array}
#
Get properties of all cells.
Returns:
An array of objects containing key
and index
properties for each cell
- Type
- Array
getCellProperties(handle) → {Object|null
}
#
null
}
#
Get properties of a given cell.
Parameters:
Returns:
An object containing the key
and index
properties of the cell.
Returns null
if the cell can't be found.
- Type
-
Object
|
null
getValidationPattern() → {RegExp|function|string}
#
Get the validation pattern to test cells against.
Returns:
insertCell([data], [index], [key])
#
Inserts a row into the table. If the row isn't added at the end of the table, all the following data will be shifted back one row.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
data |
number | string |
optional |
The data to insert to the cell. |
index |
number |
optional |
The index in which to insert the new cell. If unset or set to null, the cell will be added at the end of the row. |
key |
string |
optional |
A key to quickly select this cell. If unset or set to null, no key will be set. |
Fires:
removeCell(handle)
#
Removes a cell from the table. If the cell removed isn't at the end of the table, all the following cells will be shifted back one cell.
Parameters:
Fires:
setIndex(index)
#
setLabel(label)
#
setValue(handle, value)
#
Set the value of a particular cell.
Parameters:
Fires:
setupRow()
#
Triggers the initialization process and builds the initial row.
Fires:
Events
clear(clear)
#
Fired when the row is cleared.
Parameters:
Name | Type | Description |
---|---|---|
clear |
boolean | Clear cell properties |
insertCell(data, index)
#
labelUpdate()
#
Fired when the row label might need to be updated.
removeCell(index)
#
Fired when a cell is removed from the row.
Parameters:
Name | Type | Description |
---|---|---|
index |
number | The removed cell index |
valueChange(index, value)
#
Fired when a value inside the row has changed.