Class: ValueListEditor

Kekule.Widget. ValueListEditor

Classes

ValueDisplayMode

Methods

appendRow(data) → {HTMLElement}

Append a row at the tail of editor.
Parameters:
Name Type Description
data Hash
Source:
Returns:
Type
HTMLElement

cancelEditing()

Cancel current editing process on activeRow and restore the old value.
Source:

clear()

Clear all rows and content in editor.
Source:

editRow(row)

Show inline edit in row and begin editting.
Parameters:
Name Type Description
row HTMLElement
Source:

finishEditing()

Finish current editing process on activeRow and save the result.
Source:

getCellContentWrapper(cell, canCreate) → {HTMLElement}

Text wrapper element (usually a ) in cell.
Parameters:
Name Type Description
cell HTMLElement
canCreate Bool
Source:
Returns:
Type
HTMLElement

getKeyCell(row) → {HTMLElement}

Returns key cell element of row.
Parameters:
Name Type Description
row HTMLElement
Source:
Returns:
Type
HTMLElement

getKeyCellHint(row, data) → {String}

Returns hint text shown in key cell. Descendants can override this method to show different texts.
Parameters:
Name Type Description
row HTMLElement
data Object
Source:
Returns:
Type
String

getKeyCellText(row, data) → {String}

Returns display text shown in key cell. Descendants can override this method to show different texts.
Parameters:
Name Type Description
row HTMLElement
data Object
Source:
Returns:
Type
String

getNextRow(row) → {HTMLElement}

Returns next row.
Parameters:
Name Type Description
row HTMLElement
Source:
Returns:
Type
HTMLElement

getParentCell(element) → {HTMLElement}

Returns parent cell child element.
Parameters:
Name Type Description
element HTMLElement
Source:
Returns:
Type
HTMLElement

getParentRow(element) → {HTMLElement}

Returns parent row of cell (or other element).
Parameters:
Name Type Description
element HTMLElement
Source:
Returns:
Type
HTMLElement

getPrevRow(row) → {HTMLElement}

Returns previous row.
Parameters:
Name Type Description
row HTMLElement
Source:
Returns:
Type
HTMLElement

getRowAt(index) → {HTMLElement}

Returns row element at index.
Parameters:
Name Type Description
index Int
Source:
Returns:
Type
HTMLElement

getRowCount() → {Int}

Returns total row count of current editor.
Source:
Returns:
Type
Int

getRowData(row) → {Hash}

Returns data (key & value) associated with row.
Parameters:
Name Type Description
row HTMLElement
Source:
Returns:
A object with key/value fields.
Type
Hash

getRowEditInfo(row) → {Hash}

Returns inline edit settings of row.
Parameters:
Name Type Description
row HTMLElement
Source:
Returns:
A object with inline edit settings.
Type
Hash

getRowElems() → {Array}

Returns all row elements in editor.
Source:
Returns:
Type
Array

getRows() → {Array}

Returns all row elements in editor. Same as getRowElems.
Source:
Returns:
Type
Array

getValueCell(row) → {HTMLElement}

Returns value cell element of row.
Parameters:
Name Type Description
row HTMLElement
Source:
Returns:
Type
HTMLElement

getValueCellText(row, data) → {String}

Returns display text shown in value cell. Descendants can override this method to show different texts.
Parameters:
Name Type Description
row HTMLElement
data Object
Source:
Returns:
Type
String

getValueEditWidgetInfo(row) → {Hash}

Returns essential information to create inline edit widget. Descendants can override this method.
Parameters:
Name Type Description
row HTMLElement
Source:
Returns:
Including {widgetClass, initialPropValues}
Type
Hash

insertRowBefore(data, refRowElem) → {HTMLElement}

Insert a row before refRowElem.
Parameters:
Name Type Description
data Hash
refRowElem HTMLElement
Source:
Returns:
Type
HTMLElement

removeRow(rowElem)

Remove a row element from editor.
Parameters:
Name Type Description
rowElem HTMLElement
Source:

removeRowAt(index)

Remove a row element at index.
Parameters:
Name Type Description
index Int
Source:

setRowData(row, data) → {HTMLElement}

Change key and value of a row element.
Parameters:
Name Type Description
row HTMLElement
data Object Must has two fields: key and value. If data.title is set, the display text in key cell will use it. Extra field can also be included.
Source:
Returns:
Type
HTMLElement

setRowEditInfo(row, info)

Set inline edit settings of row.
Parameters:
Name Type Description
row HTMLElement
info Hash This param is a hash that may containing the following fields: { widgetClass: widget class need to be create during inline-editing, propValues: A hash object to init the widget, e.g. {'items': [{'key1', 'value1'}]} for select box. }
Source:

setValueCellText(valueText, row)

After editing finished, feedback value string to data. Descendants may override this method to do some real work.
Parameters:
Name Type Description
valueText String
row HTMLElement
Source:

updateAll()

Force to update display text in key/value cell of all rows.
Source:

valueCellTextToValue(valueText, row, oldData)

After editing finished, convert value string into real data value. Descendants may override this method to do some transform from valueText to actual value.
Parameters:
Name Type Description
valueText String
row HTMLElement
oldData Object
Source:

Events

activeRowChange

Invoked when the active row is changed. Event param of it has field: {row} where row may be a empty value means no activeRow now.
Source:

editCancel

Invoked when the active row edit is cancelled and new value is discarded. Event param of it has field: {row}.
Source:

editFinish

Invoked when the active row edit is finished and new value is saved. Event param of it has field: {row}.
Source: