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

updateCollection

Description

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

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

Parameters

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

Returns

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

Example

scheduler.config.lightbox.sections=[   
{name:"description", height:130, map_to:"text", type:"textarea" , focus:true},
{name:"items", height:23, type:"select",
options:scheduler.serverList("goods", goods_array), map_to:"section_id" },
{name:"time", height:72, type:"time", map_to:"auto"}
];

Details

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

Examples

Select control

Рассмотрим lightbox, настроенный следующим образом:

scheduler.config.lightbox.sections = [
{ name: "description", ...},
{ name: "sections", type: "select", options: scheduler.serverList("sections"), /*!*/
map_to: "section_id" },
{ name: "time", ... }
];

С таким объявлением можно обновлять опции в выпадающем списке через список с именем 'sections'.
To update the 'sections' list you can use:

scheduler.updateCollection("sections", [
{ key: 5, label: "Section E" },
{ key: 6, label: "Section F" },
{ key: 7, label: "Section G" }
]);

Units view

Предположим, у вас есть Units view, настроенный так:

scheduler.createUnitsView({
name: "unit",
property: "section_id",
list: scheduler.serverList("sections") /*!*/
});

Чтобы изменить список отображаемых юнитов, используйте:

scheduler.updateCollection("sections", [
{ key: 5, label: "Section E" },
{ key: 6, label: "Section F" },
{ key: 7, label: "Section G" }
]);
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.