Перейти к основному содержимому

updateCollection

Description

Обновляет указанную коллекцию новыми опциями

updateCollection: (collection: string | number, options: any[]) => boolean

Parameters

  • collection - (required) string | number - имя коллекции, которую нужно обновить
  • options - (required) array - новые значения коллекции

Returns

  • collection - (boolean) - true, если обновление прошло успешно; false, если коллекция не найдена

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

  • Метод вызывает событие onOptionsLoad и сбрасывает lightbox.
  • Коллекция может быть создана с помощью метода serverList.

Examples

Контроль select

Предположим, что у вас lightbox, как показано ниже:

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"}
];

Такое объявление позволит обновлять опции в контроле select через список с именем 'priorities'. Чтобы обновить список 'priorities', можно использовать:

gantt.updateCollection("priorities", new_priorities_array);
Need help?
Got a question about the documentation? Reach out to our technical support team for help and guidance. For custom component solutions, visit the Services page.