updateCollection

updates the specified collection with new options

boolean updateCollection(string | number collection,array options);
collectionstring | numberthe name of the collection to update
optionsarraythe new values of the collection
booleantrue, if the update was successful; false, if the collection wasn't found

Example

gantt.config.lightbox.sections = [
    {name:"description", height:38, map_to:"text", type:"textarea", focus:true},
    {name:"priority", height:22, map_to:"priority", type:"select",              options:gantt.serverList("priorities", values_array)},                                                                         {name:"time", height:72, type:"duration", map_to:"auto"}
];
 
gantt.updateCollection("priorities", new_values_array);

Details
  • The method calls the onOptionsLoad event and resets the lightbox.
  • The collection can be created with the serverList method.

Examples

Select control

Let's assume that you have the lightbox as in:

gantt.config.lightbox.sections = [
    {name:"description", height:38, map_to:"text", type:"textarea", focus:true},
    {name:"priority", map_to:"priority", type:"select", 
        options:gantt.serverList("priorities")},                                                                        {name:"time", height:72, type:"duration", map_to:"auto"}
];

With such declaration it would be possible to update options in the select control through the list named 'priorities'.
To update the 'priorities' list you can use:

gantt.updateCollection("priorities", new_priorities_array);
See also
Back to top