forked from fanruan/fineui
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
1.1 KiB
41 lines
1.1 KiB
8 years ago
|
Demo.TreeValueChooser = BI.inherit(BI.Widget, {
|
||
|
props: {
|
||
8 years ago
|
baseCls: "demo-tree-value-chooser-combo"
|
||
8 years ago
|
},
|
||
|
render: function () {
|
||
|
|
||
|
var tree = [];
|
||
8 years ago
|
for (var i = 0; i < 221; i++) {
|
||
8 years ago
|
tree.push({
|
||
8 years ago
|
value: "" + i + "",
|
||
|
text: "" + i + "",
|
||
8 years ago
|
id: i + "",
|
||
|
pId: null
|
||
|
});
|
||
|
for (var j = 0; j < 9; j++) {
|
||
|
tree.push({
|
||
|
value: i + "-" + j,
|
||
|
text: j + "",
|
||
|
id: i + "-" + j,
|
||
|
pId: i + ""
|
||
|
})
|
||
|
}
|
||
|
}
|
||
|
var widget = BI.createWidget({
|
||
|
type: "bi.tree_value_chooser_combo",
|
||
8 years ago
|
width: 300,
|
||
8 years ago
|
items: tree,
|
||
|
itemsCreator: function (op, callback) {
|
||
|
callback(tree);
|
||
|
}
|
||
|
});
|
||
|
return {
|
||
|
type: "bi.vertical",
|
||
|
hgap: 200,
|
||
|
vgap: 10,
|
||
|
items: [widget]
|
||
|
};
|
||
|
}
|
||
|
});
|
||
8 years ago
|
BI.shortcut("demo.tree_value_chooser_combo", Demo.TreeValueChooser);
|