Posted 21 November 2021, 5:48 pm EST
Hi,
How do you dynamically or programmatically populate or clear a List?
I created a sidepanel UI and in it is a List with hard coded items
{
type: "List",
bindingPath: "list1",
id: "gc_list",
className: "gc_list_container",
items: [
{ text: 'Item 1', value: '1' },
{ text: 'Item 2', value: '2' }
}
Looking at the code I see there is a way to create a List like the code below but the API documentation does not show where to access this.
var d = new C.List(this.root, {
type: "List",
items: n.listContent,
command: n.commandName,
maxHeight: n.dropdownMaxHeight,
wrap: !0,
maxWidth: n.maxWidth,
direction: 0,
align: 0,
useCapture: !1,
allowSelection: !1
});
An instance of this List seems to have methods/properties listed below that will be usefully to programmatically populate and control the List.
- updateValue
- selectedIndex
- itemsCount
- _items
I’m aware you can Add a Custom Component but seeing that there is already an existing List component, it seems possible to to use this existing component.
In addition there seems to be a multiSelectList as well. Any tip in using that will be helpful as well.
Thank you