The framework provides a
This function only gives you a final result. You don't get an initial creation message from the dialog which gives you the ability to destroy it.
You can display a more complex list, with multiple levels and with additional options such as icons, using Framework.MenuListDialog()
Framework.SelectFromList([
{value: "close", caption: "Close"},
{value: "reverse", caption: "Reverse"},
{value: "double", caption: "Double", someExtraData: "x2"}
], function (selection) {
// Either null, or one of the objects in the array
});
You can pass three types of list as the first parameter:
A simple array of values, such as
An array of objects, like the example above. Each object must have a
Full dialog initialisation, including the ability to set standard properties such as noCancel, containing an
As an example of the third type, the following code displays the same list of options as the example above, but customises the title and adds the
Framework.SelectFromList({
title: "What shall we do?",
noCancel: true,
items: [
{value: "close", caption: "Close"},
{value: "reverse", caption: "Reverse"},
{value: "double", caption: "Double", someExtraPrivateData: "x2"}
]
}, function (selection) {
// Either null, or one of the objects in the array
});