返回一个选项列表
list_name | string | number | 列表的名称 |
options | array | 包含选项的数组 |
array | 一个选项数组 |
// 获取名为 'my_list' 的选项列表
var list = gantt.serverList("my_list");
...
// 创建并返回一个包含指定选项的列表
var list = gantt.serverList("options", [
{key: 1, label: "John"},
{key: 2, label: "Adam"},
{key: 3, label: "Diane"}
]);
这种方式方便通过管理命名列表来更新类似 select 选项的集合。
// 该配置允许从名为 'persons' 的列表加载选项
gantt.config.lightbox.sections=[
{name:"description", height:130, map_to:"text", type:"textarea" , focus:true},
{name:"persons", height:23, type:"select",
options:serverList("persons", persons_array), map_to:"section_id" }
];
Back to top