Adds a ListView to a named exoskeleton form.
Emits 'Click' and 'DoubleClick' events if 'emitEvents' is true.
ListView has the following view modes (defined by 'View' property) :
- LargeIcon: 'Thumbnail-like' list using 'Items' payload property (no subitems).
- Details - Tabular list using 'ItemArrays' 2-dimensional payload property for subitems.
- SmallIcon - 'Left-to-Right, Top-to-Bottom' list needing only 'Items' payload property.
- List - 'Top-to-Bottom' list needing only 'Items' payload property.
- Tile - 'L->R, T->B' list with large icons, displaying subitems as multiple lines (2D 'ItemArrays')
The various allowable payloads include :
- 'Columns' - In a tabular view mode these define the column captions/sizes ('Text', 'Width')
- 'Items' - Items array supports single dimension array where each array element is a different list item.
- 'ItemArrays' - ItemArrays support 2-dimension array allowing multiple columns for each 'row'.
- 'AppendItems' - AppendItems is the same as 'Items' but the list will not be cleared before adding those (new) items.
- 'AppendItemArrays' - AppendItemArrays will not clear the listview before appending the new items.
See ms docs.
Parameters
formName (string)
unique name to dialog/form to refer to your form.
listview ((object | string))
initial properties to assign to ListView
parentName (string?)
optional name of parent control to nest within
emitEvents (boolean?)
whether this control should emit event(s)
payload (string?)
can be used to pass 'Columns', 'Items' and/or 'ItemArrays' properties
Example
var controlProperties = { Name: "CountryList", Top: 10, Left: 10, Dock: 'Fill', View: "LargeIcon" };
var controlPayload = {
LargeImageList: "LargeListIcons",
Items: [{ Text: "One", ImageIndex: 0 }, { Text: "Two", ImageIndex: 1 }]
};
exoskeleton.form.addListView("ExampleForm", controlProperties, "AddressPanel", false, controlPayload);
controlProperties = { Name: "CountryList", Top: 10, Left: 10, Dock: 'Fill', View: "Details", FullRowSelect: true }
var controlPayload = {
SmallImageList: "SmallListIcons",
Columns: [{ Text: "Country", Width:100 }, { Text:"Info1", Width: 120 }, { Text: "Info2", Width: 100 }],
ItemArrays: [
[{ Text: "Item One", ImageIndex: 0 }, { Text: "Stuff about One" }, { Text: "More stuff about One" } ],
[{ Text: "Item Two", ImageIndex: 1 }, { Text: "Stuff about Two" }, { Text: "More stuff about Two" } ],
[{ Text: "Item Three", ImageIndex: 2 }, { Text: "Stuff about Three" }, { Text: "More stuff about Three" }]
]
};
exoskeleton.form.addListView("ExampleForm", controlProperties, "AddressPanel", false, controlPayload);