Constructor
new RowInfo(setName, rowLevel, field, key, valueCompound, isUndeclaredEntryopt)
This keeps information for a row to display (at any given RowLevel). It populates the fields from given parameters, and it collects some extra fields.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
setName |
string | undefined | set name (if the module allows sets and we're at set level or deeper); otherwise it's undefined
attribute for the |
|
rowLevel |
RowLevel | ||
field |
SeLiteSettings.Field | An object of a subclass of Field. If rowLevel==RowLevel.MODULE or rowLevel==RowLevel.SET, then field is null. | |
key |
string | Key for the value to display. If no such key, it should be undefined. It must be defined for multivalued or choice field when rowLevel===RowLevel.OPTION. It serves as a trailing part of field option preference name) -- for multivalued non-choice fields it should be the same as value in valueCompound -- if the field is of a subclass of Field.Choice or Field.FixedMap, then key may differ to (current value in valueCompound. | |
valueCompound |
SeLiteSettings.FieldInformation | Value compound for a given field. See also Module#getFieldsDownToFolder() or Module#getFieldsOfSet(). | |
isUndeclaredEntry |
boolean |
<optional> |
Whether this is a value of an undeclared field, or a value of an undeclared key of a declared Field.FixedMap. Required if rowLevel===RowLevel.FIELD. |
Methods
collectEditable(column) → {boolean}
Parameters:
Name | Type | Description |
---|---|---|
column |
Column |
Returns:
Value to use for 'editable' attribute - but convert it to a string first.
- Type
- boolean
collectLabel(column) → {string|undefined}
Parameters:
Name | Type | Description |
---|---|---|
column |
Column |
Returns:
Value to use for 'label' attribute (which also shows up for editable cells other than checkbox/radio button), potentially an empty string.
- Type
- string | undefined
collectProperties(column) → {string}
Parameters:
Name | Type | Description |
---|---|---|
column |
Column |
Returns:
Value to use for 'properties' attribute of a trecell, potentially an empty string. Not used for 'properties' of tree row - that is set by generateTreeItem().
- Type
- string
collectValue(column) → {string}
Parameters:
Name | Type | Description |
---|---|---|
column |
Column |
Returns:
Value to use for 'value' attribute, potentially an empty string. 'value' only controls checked/unchecked state of checbkox/radio button; it doesn't show as text, which comes from 'label' - see collectLabel().
- Type
- string
generateTreeItem()
Returns:
object for a new element with one
nullOrUndefineLabel() → {string}
Generate text for label for 'Null/Undefine' column. Use only in editable mode, not in per-folder mode.
Returns:
Empty string, 'Null' or 'Undefine', as an appropriate 'label' property for Column.NULL_UNDEFINE_DEFINITION for this field/entry with the given value.
- Type
- string
setAllCellDetails(Object, createCells)
Set details of all cells in a given treerow. Optional: create the cells.
Parameters:
Name | Type | Description |
---|---|---|
Object |
object | for <treerow> element. |
createCells |
boolean | Whether to create the cells. |
setCellDetails(treecell, column)
Parameters:
Name | Type | Description |
---|---|---|
treecell |
object | result of window.document.createElementNS( XUL_NS, 'treecell') |
column |
Column |