serverList

returns a list of options

array serverList(string list_name, [array options] );

Parameters

list_namestringthe name of a list
optionsarrayoptional, an array of options

Returns

arraya list of options

Example

//returns a list of options with the name 'my_list'
var list = scheduler.serverList("my_list"); 
...
//creates and returns the specified list
var list = scheduler.serverList("options", [
    {key: 1, label: "John"},
    {key: 2, label: "Adam"},
    {key: 3, label: "Diane"}
]);

Related samples

Details
  • If the method is called only with the first parameter, the method will return a list with that name (if exists).
  • If the method is called with 2 parameters, the scheduler will create a list with the specified name or,if a list with such name already exists, the scheduler will rewrite it

Lists, created with the method, can be after updated with the updateCollection method.

That's why, if there is a need to update collections, e.g. select options, a list of units in the Timeline, Units view, it's a good idea to create them as a named list of options.

// with such declaration it would be possible to update options 
// in the select element through the list named 'goods'
 
scheduler.config.lightbox.sections=[   
    {name:"description", height:130, map_to:"text", type:"textarea" , focus:true},
    {name:"items", height:23, type:"select", 
    options:serverList("goods", goods_array), map_to:"section_id" }, 
    {name:"time", height:72, type:"time", map_to:"auto"}
]; 
...
// the same, but with the "units" list
scheduler.createUnitsView({
    name:"unit",
    property:"section_id",
    list:scheduler.serverList("units", sections),
    size:20,
    step:1
});
See also
Back to top