new ForEachLimited(dimension, data, dataType, renderer [, linePadding] [, selectable] [, multipleSelection] [, horizontal])
Creates an instance of ForEachLimited.
Parameters:
| Name | Type | Argument | Default | Description |
|---|---|---|---|---|
dimension |
olympe.df.Proxy.<olympe.df.Vector2> | olympe.df.Vector2 | The dimension (w,h) of this element. |
||
data |
olympe.df.Proxy.<olympe.df.SortedEnumerable> | olympe.df.SortedEnumerable | The content list. |
||
dataType |
olympe.df.Proxy.<function(new:T, ...?)> | function | The type of the content elements. |
||
renderer |
olympe.ui.std.ForEachLimited.Renderer | The renderer for the elements. |
||
linePadding |
olympe.df.Proxy.<olympe.df.ONumber> | olympe.df.ONumber | number |
<optional> |
0 | The padding (space), in pixels between lines. |
selectable |
olympe.df.POBoolean | boolean |
<optional> |
false |
|
multipleSelection |
olympe.df.POBoolean | boolean |
<optional> |
false |
|
horizontal |
boolean |
<optional> |
false |
|
Methods
-
getContentDimension()
-
Gets the dimension of the content.
Returns:
The content dimension.
- Type
- olympe.df.PVector2
-
getSelectedElements()
-
Gets the selected elements.
Returns:
A map containing the selected elements.
- Type
- olympe.df.Map.<T>
-
setAsSelected(indexes)
-
Marks a set of elements of this
ForEachLimitedas 'selected' as if the user had done it.Parameters:
Name Type Description indexesolympe.df.Enumerable.<string> | Array.<string> | string The indexes of the elements to select.
Returns:
This
ForEachLimited. -
setKeepSelection(keepSelection)
-
Ensures that at least an element is always selectable, if
true.Parameters:
Name Type Description keepSelectionboolean
Type Definitions
-
Renderer(element, rank, selected)
-
Renderer for element of a
olympe.ui.std.ForEachLimited. It has to return a UI component based on the 3 data flows passed as arguments:- The element's value.
- Its rank.
- Whether it is selected or not.
Parameters:
Name Type Description element* The element's value.
rankolympe.df.Proxy.<number> | number The element's rank.
selectedolympe.df.Proxy.<olympe.df.OBoolean> | olympe.df.OBoolean trueif that element is selected.Returns:
The created UI component.
Olympe SDK