new Rollist(host, oOptionsopt)
The ExRollist/JS component is an interactive list control that arranges its items along the path of an ellipse. As users navigate through the list, the selected item is automatically positioned and displayed at the center of the control, ensuring maximum visibility and focus. This layout creates a smooth and visually engaging experience when browsing items.
Features include:
- Elliptical Layout, items are arranged along an elliptical path for a modern, visually engaging presentation (supports liner arrangement as well)
- Centered Selection, ihe selected item is always displayed in the center of the control for better visibility and focus
- Smooth Scrolling & Animation, offers smooth, animated transitions when navigating through items
- Filter Support, allows users to filter items dynamically as they type characters to match
- Mouse & Touch Support, fully interactive via mouse wheel and touch gestures such as swipe or drag
- Customizable Items, items can include rich HTML content, images, or custom styles
- Keyboard Navigation, allows users to navigate the list using keyboard input (e.g., arrow keys)
- Lightweight & Fast, designed for performance, even with large numbers of items
- Responsive Design, automatically adapts to the size of its container for flexible integration
Every option of the Rollist.Options type has associated a property of the control. For instance, the option:
allowActions {string}, customizes the actions the user can perform once the user clicks or touches the controlis associated with the property:
AllowActions {string}, customizes the actions the user can perform once the user clicks or touches the controlwhich means that the following statements are equivalent:
oRollist.Options = {allowActions: "scroll"}where oRollist is an object of Rollist type
oRollist.SetOptions({allowActions: "scroll"})
oRollist.AllowActions = "scroll"
oRollist.SetAllowActions("scroll")
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
host |
any | The host parameter specifies the HTML element hosting the control. It can be one of the following:
|
|
oOptions |
object |
<optional> |
An object of Rollist.Options type that defines different options to display the control. |
Requires:
- module:exontrol.commmon.min.js
Requires
- module:exontrol.commmon.min.js
Classes
Members
Listeners :exontrol.Lts
The Listeners field defines the items of the control, as an object of exontrol.Lts type. The exontrol.Lts type supports forEach(callback, thisArg) method that helps you to enumerate the items the control supports. The Items section lists the items the component supports.
Type:
- exontrol.Lts
Example
The following sample shows how you can get all items the component currently supports:
oRollist.Listeners.forEach(function(name)
{
console.log(name);
});
The following samples handle the "onload" event:
oRollist.Listeners.Add("onload", function (oEvent)
{
console.log(oEvent);
});
or
oRollist.on("load", function (oEvent)
{
console.log(oEvent);
});
where oRollist is an object of Rollist type
Listeners
(static, readonly) AllowFilterInputEnum :number
The Rollist.AllowFilterInputEnum type defines the options and flags that control the visibility of the filter input in the control.
Type:
- number
Properties:
Name | value | Type | Description |
---|---|---|---|
exHide |
0 |
number | No filter input is visible |
exAlwaysVisible |
1 |
number | The filter input is always visible, the close button is not displayed |
exShowOnAnyKey |
2 |
number | Displays the filter input when the user presses a key, along with a close button. Requires the HTML element hosting the control to include the tabindex attribute to receive keyboard focus. |
exDisableHighlightOccurences |
16 |
number | Disables the highlighting of all occurrences of the typed text within the items, which otherwise helps users visually identify matching content. |
(static) type :string
The type field defines the full-name of the object (the constructor.name does not give the same name for minimized forms).
The Rollist.type member always returns "Rollist"
Type:
- string
(static) version :string
The version field defines the version of the control.
The current version is 4.4
Type:
- string
Methods
BeginUpdate()
The BeginUpdate() method suspends the control's render until the EndUpdate() method is called. It maintains performance, while multiple changes occurs within the control. You can use the Update() method to perform multiple changes at once.
CloseFilterInput()
The CloseFilterInput() method hides and clears the filter input field, effectively removing it from view and disabling the filtering functionality. It also clears any active filter.
EndUpdate()
The EndUpdate() method resumes the control's render, after it is suspended by the BeginUpdate() method.
GetAllowActions() → {string}
The GetAllowActions() method gets the actions the user can perform once the control is clicked or touched
Returns:
Returns the actions the user can perform once the control is clicked or touched.
The format of allowActions field is:
"action(shortcut,shortcut,...),action(shortcut,shortcut,...)..."where
- "action", indicates the name of the action. The "action" can have any of the following values:
- "scroll", scrolls the control by drag and drop
- "shortcut", defines the event's button or/and the modifier-keys that are required to perform the action. The "shortcut" is a combination of none, one or more of the following values:
- "Shift", indicates that the SHIFT key is pressed
- "Ctrl" or "Control", indicates that the CTRL key is pressed
- "Alt" or "Menu", indicates that the ALT key is pressed
- "Meta" , indicates that the META key is pressed
- "LButton", specifies that the mouse's left-button is pressed
- "RButton", specifies that the mouse's right-button is pressed
- "MButton", specifies that the mouse's middle/wheel-button is pressed
- "Long", specifies that the action requires a "long" click or touch before it begins
- "Double", specifies that the action requires a "double" click before it begins (this flag is available for non-dragable actions only such as "edit")
- "+", indicates AND between values
- Type
- string
GetAllowFilterInput() → {Rollist.AllowFilterInputEnum}
The GetAllowFilterInput() method specifies whether the control displays a filter bar, enabling the user to filter items that contain the typed text.
Returns:
Returns a value from the AllowFilterInputEnum that indicates the current filter input mode. Possible values include:
GetAllowFilterInput
- exHide (0), no filter input is visible
- exAlwaysVisible (1), the filter input is always visible, without a close button
- exShowOnAnyKey (2), displays the filter input when the user presses any key, including a close button. Requires the host HTML element to have a tabindex attribute for keyboard focus
- exDisableHighlightOccurences (0x10), disables the highlighting of all occurrences of the typed text within the items, which otherwise helps users visually identify matching content.
GetCyclic() → {boolean}
The GetCyclic() method indicates whether the items are displayed in a continuous loop.
Returns:
Returns true if the items are displayed in a continuous loop
- Type
- boolean
GetFilter() → {string}
The GetFilter() method specifies the filter to be applied to the items, ensuring that only items matching the filter criteria are shown.
Returns:
Returns the filter to be applied to the items
- Type
- string
GetItems() → {Items}
The GetItems() method returns the control's items.
Returns:
Returns an object of Items type.
- Type
- Items
Example
The following statements are equivalents:
oRollist.GetItems() {Items}, returns the control's items
oRollist.Items {Items}, returns the control's items
where oRollist is an object of Rollist type
GetItems
GetMisc() → {MiscellaneousOptions}
The GetMisc() method indicates the control's miscellaneous options
Returns:
Returns the control's miscellaneous options
- Type
- MiscellaneousOptions
GetOptions() → {object}
The GetOptions() method returns the current options of the control.
Returns:
An object of Rollist.Options type that indicates the options to display the control.
- Type
- object
GetSelect() → {Item}
The GetSelect() method gets the item that is currently selected, which is always displayed at the center of the control
Returns:
Returns the selected item, which is always displayed at the center of the control
- Type
- Item
GetSmooth() → {number}
The GetSmooth() method defines the time in ms the control goes from one layout to another.
Returns:
Returns the time in ms the control goes from one layout to another.
- Type
- number
GetWheelChange() → {number}
The GetWheelChange() method defines the amount the control scrolls when the user rolls the mouse wheel.
Returns:
Returns the amount the control scrolls when the user rolls the mouse wheel.
- Type
- number
Import(source, importOptsopt)
The Import() method imports data from CSV format. The SetData(value) method is equivalent with Import(value) method.
Parameters:
Name | Type | Attributes | Description | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
source |
any | The source parameter may be one of the following:
|
||||||||||||||||||||||
importOpts |
object |
<optional> |
The importOpts parameter specifies options to import data into the control as object of ImportOptions type.
Properties
|
Item(id) → {Item}
The Item() method returns the item based on its index or identifier/key. The Item(id) method is equivalent with Item(id) method of the Items object (not to be confused with item method that gets the item by its position)
Parameters:
Name | Type | Description |
---|---|---|
id |
any | The item parameter could be any of the following:
|
Returns:
Returns null or an object of Item type
- Type
- Item
Refresh()
The Refresh() method refreshes the control
SetAllowActions(value)
The SetAllowActions() method customizes the actions the user can perform once the control is clicked or touched
Parameters:
Name | Type | Description |
---|---|---|
value |
string | Indicates the actions the user can perform once the control is clicked or touched.
The format of allowActions field is:
"action(shortcut,shortcut,...),action(shortcut,shortcut,...)..."where
|
Example
null {null}, indicates the control's default allowActions value
"" {string}, specifies that no operation is allowed once the user clicks or touches the control
"scroll" {string}, specifies that only "scroll" operation is allowed, no matter of the event's button or modifier-keys is pressed.
SetAllowActions
SetAllowFilterInput(value)
The SetAllowFilterInput() method specifies whether the control displays a filter bar, enabling the user to filter items by typing text. The ShowFilterInput programmatically displays the filter input field of the control.
Parameters:
Name | Type | Description |
---|---|---|
value |
Rollist.AllowFilterInputEnum | Specifies how the filter input is displayed, as one of the following:
|
Example
null {null} or "hide" {string} or exontrol.Rollist.AllowFilterInputEnum.exHide {AllowFilterInputEnum} or 0 {number}, no filter input is visible (by default)
"always" {string} or exontrol.Rollist.AllowFilterInputEnum.exAlwaysVisible {AllowFilterInputEnum} or 1 {number}, indicates that the filter input is always visible
"key,disable" {string} or (exontrol.Rollist.AllowFilterInputEnum.exShowOnAnyKey | exontrol.Rollist.AllowFilterInputEnum.exDisableHighlightOccurences) {AllowFilterInputEnum} or 0x12 {number}, shows the filter input when the user presses any key and disables the highlighting of all occurrences of the typed text in the items
SetAllowFilterInput
SetCyclic(value)
The SetCyclic() method indicates whether the items are displayed in a continuous loop.
Parameters:
Name | Type | Description |
---|---|---|
value |
boolean | Indicates whether the items are displayed in a continuous loop. |
SetData(value)
Imports data from CSV files. The SetData(value) method is equivalent with Import(value) method. The ImportOptions type defines default options to import data.
Parameters:
Name | Type | Description |
---|---|---|
value |
any | Indicates the source of the data, as one of the following:
|
Example
"data.txt" {string}, imports data from data.txt file
SetData
SetFilter(value)
The SetFilter() method specifies the filter to be applied to the items, ensuring that only items matching the filter criteria are shown.
Parameters:
Name | Type | Description |
---|---|---|
value |
string | Specifies the filter to be applied to the items. |
Example
null {null} or "" {string}, clear the filter (if applied)
"icon" {string}, filters the items to display only those that contain the word 'icon'
SetFilter
SetMisc(value)
The SetMisc() method defines the control's miscellaneous options
Parameters:
Name | Type | Description |
---|---|---|
value |
MiscellaneousOptions | A value that indicates the control's miscellaneous options. |
SetOptions(nOptions, bIncludeAllopt) → {boolean}
The SetOptions() method applies new options to the view.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
nOptions |
object | Specifies an object of Rollist.Options type that indicates the new options to apply | |
bIncludeAll |
boolean |
<optional> |
Indicates whether all fields of nOptions are included in the item's oOptions object |
Returns:
Returns true, if there were options applied to the item
- Type
- boolean
Example
oRollist.Options = {imageAlign: 1, imageSize: 24}, changes the alignment and the size for all images within the control.
The oRollist.Options = value statement is equivalent with oRollist.SetOptions(value) or oRollist.SetOptions(value)
SetOptions
SetSelect(value)
The SetSelect() method sets the item that is currently selected, which is always displayed at the center of the control
Parameters:
Name | Type | Description |
---|---|---|
value |
any | Indicates one of the following:
|
SetSmooth(value)
The SetSmooth() method changes the time in ms the control goes from one layout to another (0 indicates no smooth-transition is performed).
Parameters:
Name | Type | Description |
---|---|---|
value |
number | Indicates the time in ms the control goes from one layout to another. |
Example
0 {number}, no smooth changes once the control goes from a layout to another
125 {number}, specifies that a smooth-transition is performed from a layout to another for 125 ms.
SetSmooth
SetWheelChange(value)
The SetWheelChange() method changes the amount the control scrolls when the user rolls the mouse wheel.
Parameters:
Name | Type | Description |
---|---|---|
value |
number | A value that specifies the amount the control scrolls when the user rolls the mouse wheel. |
Example
0 {number}, locks any action the mouse's wheel performs
18 {number}, scrolls the control by 18-pixels when mouse's wheel is rotated (CTRL + wheel scrolls horizontally)
SetWheelChange
ShowFilterInput()
The ShowFilterInput() method displays the filter input field, enabling the user to type keywords for filtering items. This allows the user to narrow down the list by matching the typed words with the items displayed.
Update(callback, thisArgopt)
The Update() method locks the control's paint during the callback, and invalidates the control once the method ends.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
callback |
callback | Indicates a callback to perform changes within the control | |
thisArg |
any |
<optional> |
Specifies the value of "this" keyword during the callback. If missing/empty/undefined the thisArg points to the control itself, as an object of Rollist type |
feI(callback, thisArgopt)
The feI/forEachItem() method invokes the callback for each item of the control
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
callback |
callback | A function of callback(oItem) type that's called for every item, where oItem is:
|
|
thisArg |
any |
<optional> |
Indicates the value of "this" keyword during the callback. If missing/empty/undefined the thisArg points to the control itself, as an object of Rollist type. |
feIU(callback, thisArgopt) → {any}
The feIU/forEachItemUnit() method invokes the callback for each item of the control, until the callback returns a not-empty value
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
callback |
callback | A function of callback(oItem) {any} type that's called for every item, where oItem is
|
|
thisArg |
any |
<optional> |
Indicates the value of "this" keyword during the callback. If missing/empty/undefined the thisArg points to the control itself, as an object of Rollist type. |
Returns:
Returns the last-value of the callback
- Type
- any
getInnerHTML(oItem,) → {string}
The getInnerHTML() method retrieves the inner HTML content of the HTML element associated with the specified item. You can override this function to gain more control over which HTML elements are displayed based on the item's content or value.
Parameters:
Name | Type | Description |
---|---|---|
oItem, |
Item | Indicates the item whose associated inner HTML is being requested. |
Returns:
Returns the inner HTML of the HTML element associated with the given item.
- Type
- string
item(position) → {Item}
The item() method retrieves an item based on its position within the Items collection (not to be confused with Item method that gets the item by its index or identifier/key)
Parameters:
Name | Type | Description |
---|---|---|
position |
number | The zero-based index of the item to retrieve. |
Returns:
The item at the specified position, or undefined if the position is invalid.
- Type
- Item
off(event, listener, methodopt)
The off() method removes an event handler that was previously bound to an event, effectively stopping the listener from responding to that event.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
event |
string | Specifies the name of the event to unbind. The event name is case-insensitive and may or may not include the 'on' prefix. For example, 'load' is equivalent to 'onload' and vice versa. | |
listener |
object | callback | Defines the listener to remove, which can either be: listener {object}, an object that implements a notification method (e.g., listener[method](oEvent) or listener[type](oEvent)) that was previously used to handle the event listener {callback}, a JavaScript callback function that was previously bound to the event (the method parameter has no effect) | |
method |
string |
<optional> |
Defines an optional case-sensitive string specifying the method on the listener to remove. If not provided, the listener[type]() function is used. This parameter is ignored when the listener is a JavaScript callback function. |
- Since:
- 4.4
Example
The following example removes the load event handler from the control:
oRollist.off("load");
where oRollist is an object of Rollist type.
This sample is equivalent to:
oRollist.Listeners.Remove("onload");
The following example removes all event handlers from the control:
oRollist.off();
where oRollist is an object of Rollist type.
This sample is equivalent to:
oRollist.Listeners.Clear();
or
oRollist.Listeners.Remove();
off
on(event, listener, methodopt) → {object}
The on() method binds a handler to a specified event, enabling you to listen for specific events and define corresponding actions.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
event |
string | Specifies the name of the event to listen for. The event name is case-insensitive and may or may not include the 'on' prefix. For example, 'load' is equivalent to 'onload' and vice versa. | |
listener |
object | callback | Defines the listener, which can either be: listener {object}, an object that implements a notification method (e.g., listener[method](oEvent) or listener[type](oEvent)) to handle the event when it occurs listener {callback}, a JavaScript callback function to handle the event directly (the method parameter has not effect) | |
method |
string |
<optional> |
Defines an optional case-sensitive string specifying the method on the listener to handle the event. If not provided, the listener[type]() function is used. This parameter is ignored when the listener is a JavaScript callback function. |
- Since:
- 4.4
Returns:
Returns the listeners of the specified type, as an exontrol.Arr({callback, thisArg, lock, name, equal}) type, which includes the following new members:
- type {string}, specifies a case-sensitive string that specifies the type of event to listen for
- do(event) {callback}, indicates a function that can be invoked to trigger the specified event for all listeners registered for that event type
- callback {callback}, defines the listener's callback function
- thisArg {any}, defines the value of this during the listener's callback execution
- lock {number}, locks or unlocks the invocation of the listener's callback
- name {string}, defines the name of the callback, mostly used for debugging purposes
- equal(oCompareListenerCallback) {callback}, indicates a function of callback(oCompareListenerCallback) {boolean} type compares the current object with the provided object. It returns true if the objects contain the same data
- Type
- object
Example
The following sample shows how you can handle the onload event:
oRollist.on("load", function()
{
console.log("onload event occured");
});
where oRollist is an object of Rollist type.
This sample is quivalent of
oRollist.Listeners.Add("onload", function ()
{
console.log("onload event occured");
});
on
Events
onadditem
The onadditem() method notifies your application that a new item has been added to the control
Parameters:
Name | Type | Description |
---|---|---|
oItem |
Item | Indicates an object of Item type being added |
Example
The following samples display the item being added:
oRollist.onadditem = function (oItem)
{
console.log(oItem);
}
or
oRollist.Listeners.Add("onadditem", function (oItem)
{
console.log(oItem);
})
or
oRollist.on("additem", function (oItem)
{
console.log(oItem);
})
where oRollist is an object of Rollist type
onadditem
onclick
The onclick() method occurs once the user clicks or double-clicks the control.
Parameters:
Name | Type | Description | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
oEvent |
object | specifies an object of {dblClick,button,modifiers,item,html} type, that holds information about the object being clicked
Properties
|
Example
The following samples show how you can handle the "click" event:
oRollist.Listeners.Add("onclick", function (oEvent)
{
console.log(oEvent);
})
or
oRollist.on("click", function (oEvent)
{
console.log(oEvent);
})
or
oRollist.onclick = function (oEvent)
{
console.log(oEvent);
}
where oRollist is an object of Rollist type.
onclick
oncreate
The oncreate() method occurs once an HTML element is created and linked to a visible item. You can use this event to associate or set additional properties or options for the newly created element.
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
oEvent |
oEvent | Defines the HTML element being constructed for a visible item, represented as an object with properties: {item,html}, where item is of type Item and html is of type HTMLElement
Properties
|
Example
The following samples sets the HTML element's tooltip:
oRollist.oncreate = function (oEvent)
{
oEvent.html.title = oEvent.html.innerText;
}
or
oRollist.Listeners.Add("oncreate", function (oEvent)
{
oEvent.html.title = oEvent.html.innerText;
})
or
oRollist.on("create", function (oEvent)
{
oEvent.html.title = oEvent.html.innerText;
})
where oRollist is an object of Rollist type
oncreate
ondestroy
The ondestroy() method occurs when the associated HTML element is removed from the DOM.
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
oEvent |
oEvent | Defines the {item,html} object representing the HTML element to be removed, which was created for a visible item
Properties
|
Example
The following samples displays the element being destroyed:
oRollist.ondestroy = function (oEvent)
{
console.log(oEvent);
}
or
oRollist.Listeners.Add("ondestroy", function (oEvent)
{
console.log(oEvent);
})
or
oRollist.on("destroy", function (oEvent)
{
console.log(oEvent);
})
where oRollist is an object of Rollist type
ondestroy
onerror
The onerror() method occurs once the control encountered an error.
Parameters:
Name | Type | Description |
---|---|---|
oEvent |
object | Specifies an object of DOMException (or any other) type that holds information about the error |
Example
The following samples display the error once it occurs:
oRollist.onerror = function (oEvent)
{
console.log(oEvent);
}
or
oRollist.Listeners.Add("onerror", function (oEvent)
{
console.log(oEvent);
})
or
oRollist.on("error", function (oEvent)
{
console.log(oEvent);
})
where oRollist is an object of Rollist type
onerror
onfilter
The onfilter() method notifies your application when the user applies or clears filters, such as by typing into the control’s filter input
Parameters:
Name | Type | Description |
---|---|---|
filter |
string | Indicates the destroyed HTML element |
Example
The following samples displays the current filter once the user changes it:
oRollist.Listeners.Add("onfilter", function (oEvent)
{
console.log(oEvent);
})
or
oRollist.on("filter", function (oEvent)
{
console.log(oEvent);
})
or
oRollist.onfilter = function (oEvent)
{
console.log(oEvent);
}
where oRollist is an object of Rollist type.
onfilter
onload
The onload() method occurs once the control loads or imports data
Example
The following samples display a message once the control loads or imports new data (for instance, the user drags and drops a file into the control):
oRollist.onload = function ()
{
alert("onload");
}
or
oRollist.Listeners.Add("onload", function ()
{
alert("onload");
})
or
oRollist.on("load", function ()
{
alert("onload");
})
where oRollist is an object of Rollist type
onload
onremoveitem
The onremoveitem() method occurs once an item has been removed from the Items collection
Parameters:
Name | Type | Description |
---|---|---|
oItem |
Item | Indicates an object of Item type being removed |
Example
The following samples display the item being removed:
oRollist.onremoveitem = function (oItem)
{
console.log(oItem);
}
or
oRollist.Listeners.Add("onremoveitem", function (oItem)
{
console.log(oItem);
})
or
oRollist.on("removeitem", function (oItem)
{
console.log(oItem);
})
where oRollist is an object of Rollist type
onremoveitem
onselect
The onselect() method notifies your application once the user selects an item at runtime (clicks an item)
Parameters:
Name | Type | Description |
---|---|---|
oEvent |
object | Indicates the item being selected as an object of Item type |
Example
The following samples show how you can handle the "select" event:
oRollist.Listeners.Add("onselect", function (oEvent)
{
console.log(oEvent);
})
or
oRollist.on("select", function (oEvent)
{
console.log(oEvent);
})
or
oRollist.onselect = function (oEvent)
{
console.log(oEvent);
}
where oRollist is an object of Rollist type.
onselect