Usage
Signature:
interface SelectorElement<K>
Generic Parameters
Parameter Description K Type of key
Typescript Import Format
//To typecheck the element APIs, import as below.
import { SelectorElement } from "ojs/ojselector";
//For the transpiled javascript to load the element's module, import as below
import "ojs/ojselector";
For additional information visit:
Note: Application logic should not interact with the component's properties or invoke its methods until the BusyContext indicates that the component is ready for interaction.
Attributes
-
indeterminate :boolean
-
Specifies if the selector should show the visual partial state. The original checked state of the selector will still be maintained. User selection of checkboxes will remove the indeterminate state and reveal the checkbox state. Otherwise, programmatically changing the checkbox state will not change the indeterminate state.
- Default Value:
false
- Supports writeback:
true
Names
Item Name Property indeterminateProperty change event indeterminateChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-indeterminate-changed -
row-key :(K|null)
-
Specifies the row key of each selector. If the selectionMode property is 'all', rowKey is ignored.
- Default Value:
null
Names
Item Name Property rowKeyProperty change event rowKeyChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-row-key-changed -
selected-keys :(KeySet.<K>|null)
-
Specifies the selectedKeys, should be hooked into the collection component.
- Default Value:
null
- Supports writeback:
true
Names
Item Name Property selectedKeysProperty change event selectedKeysChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-selected-keys-changed -
selection-mode :"all"|"multiple"|"single"
-
Specifies the selection mode ('single', 'multiple', 'all'). 'all' should only be used for the select all case and will ignore the key property.
- Default Value:
'multiple'
Supported Values:
Value Description allSpecifies the select all case (rowKey property is ignored). multipleMultiple items can be selected at the same time. singleOnly a single item can be selected at a time. Names
Item Name Property selectionModeProperty change event selectionModeChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-selection-mode-changedExample
<oj-selector selected-keys='{{selectedItems}}' selection-mode='all'> </oj-selector>
Methods
-
getProperty(property) : {any}
-
Retrieves a value for a property or a single subproperty for complex properties.
Parameters:
Name Type Description propertystring The property name to get. Supports dot notation for subproperty access. Returns:
- Type
- any
-
setProperties(properties) : {void}
-
Performs a batch set of properties.
Parameters:
Name Type Description propertiesObject An object containing the property and value pairs to set. Returns:
- Type
- void
-
setProperty(property, value) : {void}
-
Sets a property or a single subproperty for complex properties and notifies the component of the change, triggering a [property]Changed event.
Parameters:
Name Type Description propertystring The property name to set. Supports dot notation for subproperty access. valueany The new value to set the property to. Returns:
- Type
- void