returns a list of options
list_name | string | number | the name of a list |
options | array | an array of options |
array | a list of options |
//returns a list of options with the name 'my_list'
var list = gantt.serverList("my_list");
...
//creates and returns the specified list
var list = gantt.serverList("options", [
{key: 1, label: "John"},
{key: 2, label: "Adam"},
{key: 3, label: "Diane"}
]);
That's why if there is a need to update collections, e.g. select options, it's a good idea to create them as a named list of options.
// with such declaration it would be possible to load options
// into the select element from the list named 'persons'
gantt.config.lightbox.sections=[
{name:"description", height:130, map_to:"text", type:"textarea" , focus:true},
{name:"persons", height:23, type:"select",
options:serverList("persons", persons_array), map_to:"section_id" }
];
Back to top