使用新的选项更新指定的 collection
collection | string | number | 要更新的 collection 名称 |
options | array | collection 的新值数组 |
boolean | 如果更新成功返回 true;如果未找到该 collection 返回 false |
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);
假设 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"}
];
在此配置下,可以通过名为 'priorities' 的 collection 更新 select 控件中的选项。
更新 'priorities' collection,只需调用:
gantt.updateCollection("priorities", new_priorities_array);