Custom List

(part of package 'Advanced Renderers') Extends designtime/SolutionModel: JSWebComponent Extends runtime: RuntimeWebComponent

This is a reference page; many components have detailed usage guides here.

Properties

dragEnabled

When set to true, allows to drag entries into another Custom List element

Type: Boolean Default Value: false


dragSortableOptions

Customize options for the drag n'drop and sortable

Type: CustomType<customrenderedcomponents-customlist.sortableOptions>


dropEnabled

When set to true, allows to drop entries from another Custom List element

Type: Boolean Default Value: false


enabled

Type: Enabled Default Value: true


entryRendererFunction

Type: Clientfunction


entryStyleClassFunction

Type: Clientfunction


responsiveDynamicHeight

Type: Boolean Default Value: false


responsiveHeight

Type: Number Default Value: 500


selectionClass

Type: Styleclass


showAs

Option whether text is shown as sanitized html or trusted html (as is).

Type: String Default Value: "html"


sortableEnabled

When set to true, allows to reorder entries within the Custom List element using drag & drop

Type: Boolean Default Value: false


styleClass

Type: Styleclass


tooltipFunction

This is a client side function that gets 2 arguments: first is the data-target (this should be set in the entry renderer) and second is the entry of the data

Type: Clientfunction


visible

Type: Visible


Events

onClick(entry,index,dataTarget,event)

Called when the mouse is clicked on a list entry

Parameters:


onDoubleClickMethodID(entry,index,dataTarget,event)

Called upon double click on a list entry

Parameters:


onDrop(event,oldIndicies,newIndicies,entriesMoved,entriesMovedTo)

Called when entries dragged from another Custom List are dropped into this Custom list element.

Parameters:


onRightClickMethodID(entry,index,dataTarget,event)

Called upon right click on a list entry

Parameters:


onSortEnd(event,oldIndicies,newIndicies,entriesMoved,entriesMovedTo)

Called when Custom List entries are reordered by drag&drop.

Parameters:


API

addStyleClassForSelector(selector,styleClass)

Adds the given style class to all items in the list's children that match the selector. Note that tag selectors are not supported.

Parameters:

  • {String} selector The CSS selector used to identify items in the list's children. Note: tag selectors are not supported.

  • {String} styleClass The style class to add to the matching items.


clear()

Clears all entries from the Custom List by setting the `data` model to an empty array. This effectively removes all items in the list.


getEntriesCount()

Retrieves the total number of entries in the Custom List.

Returns: Number The number of entries in the `data` model. Returns 0 if the `data` model is not initialized.


getEntry(index)

Retrieves a specific entry from the Custom List based on the given index.

Parameters:

  • {Number} index The 0-based index of the entry to retrieve.

Returns: Object The entry at the specified index, or null if the index is out of range or the `data` model is not initialized.


newEntry()

Creates a new entry in the Custom List and adds it to the `data` model. If the `data` model is uninitialized, it initializes it as an empty array before adding the entry.

Returns: Object The newly created entry added to the `data` model.


removeEntry(index)

Removes a specific entry from the Custom List based on the given index.

Parameters:

  • {Number} index The 0-based index of the entry to remove.

Returns: boolean Returns true if the entry was successfully removed, or false if the index is out of range or the `data` model is not initialized.


removeStyleClassForSelector(selector,styleClass)

Removes the given style class from all items in the list's children that match the selector. Note that tag selectors are not supported.

Parameters:

  • {String} selector The CSS selector used to identify items in the list's children. Note: tag selectors are not supported.

  • {String} styleClass The style class to remove from the matching items.


setEntries(entries)

Replaces the existing entries in the Custom List with the specified array of entries.

Parameters:

  • {Array<object>} entries An array of objects representing the new set of entries for the `data` model.


Types

sortableOptions

scripting type: CustomType<customrenderedcomponents-customlist.sortableOptions>


Last updated

Was this helpful?