使用新的选项更新指定的 collection
collection | string | 要更新的 collection 名称 |
options | array | collection 的新值列表 |
boolean | true,如果更新成功;false,如果未找到该 collection |
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"}
];
假设有如下配置的 lightbox:
scheduler.config.lightbox.sections = [
{ name: "description", ...},
{ name: "sections", type: "select", options: scheduler.serverList("sections"), map_to: "section_id" },
{ name: "time", ... }
];
通过此配置,可以通过修改名为 'sections' 的列表来更新 select 控件中的选项。
要更新 'sections' 列表,可以执行如下操作:
scheduler.updateCollection("sections", [
{ key: 5, label: "Section E" },
{ key: 6, label: "Section F" },
{ key: 7, label: "Section G" }
]);
假设有如下配置的 Units 视图:
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" }
]);