Browse Source

update demo

es6
zsmj 2 years ago
parent
commit
66544d73be
  1. 50
      demo/js/widget/selecttree/demo.multilayer_select_tree_combo.js
  2. 52
      demo/js/widget/selecttree/demo.select_tree_combo.js
  3. 48
      demo/js/widget/singletree/demo.multilayer_single_tree_combo.js

50
demo/js/widget/selecttree/demo.multilayer_select_tree_combo.js

@ -11,30 +11,32 @@ Demo.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, {
var items = BI.deepClone(Demo.CONSTANTS.TREE); var items = BI.deepClone(Demo.CONSTANTS.TREE);
return { return {
type: "bi.horizontal_auto", type: "bi.horizontal_auto",
items: [{ items: [
type: "bi.multilayer_select_tree_combo", {
ref: function (_ref) { type: "bi.multilayer_select_tree_combo",
self.tree = _ref; ref: function (_ref) {
}, self.tree = _ref;
defaultText: "请选择", },
items: items, defaultText: "请选择",
width: 300, items: items,
value: ["第五级文件1"] width: 300,
}, { value: ["第五级文件1"]
type: "bi.button", }, {
text: "getVlaue", type: "bi.button",
handler: function () { text: "getVlaue",
BI.Msg.toast(self.tree.getValue()[0]); handler: function () {
}, BI.Msg.toast(self.tree.getValue()[0]);
width: 300 },
}, { width: 300
type: "bi.button", }, {
text: "setVlaue (第二级文件1)", type: "bi.button",
handler: function () { text: "setVlaue (第二级文件1)",
self.tree.setValue(["第二级文件1"]); handler: function () {
}, self.tree.setValue(["11"]);
width: 300 },
}], width: 300
}
],
vgap: 20 vgap: 20
}; };
} }

52
demo/js/widget/selecttree/demo.select_tree_combo.js

@ -11,33 +11,35 @@ Demo.SelectTreeCombo = BI.inherit(BI.Widget, {
var items = BI.deepClone(Demo.CONSTANTS.LEVELTREE); var items = BI.deepClone(Demo.CONSTANTS.LEVELTREE);
return { return {
type: "bi.horizontal_auto", type: "bi.horizontal_auto",
items: [{ items: [
type: "bi.select_tree_combo", {
ref: function (_ref) { type: "bi.select_tree_combo",
self.tree = _ref; ref: function (_ref) {
}, self.tree = _ref;
value: "11", },
text: "默认值", value: "11",
items: items, text: "默认值",
width: 300 items: items,
}, { width: 300
type: "bi.button", }, {
text: "getVlaue", type: "bi.button",
handler: function () { text: "getVlaue",
BI.Msg.toast(self.tree.getValue()[0]); handler: function () {
}, BI.Msg.toast(self.tree.getValue()[0]);
width: 300 },
}, { width: 300
type: "bi.button", }, {
text: "setVlaue (第二级文件1)", type: "bi.button",
handler: function () { text: "setVlaue (11)",
self.tree.setValue(["2"]); handler: function () {
}, self.tree.setValue(["2"]);
width: 300 },
}], width: 300
}
],
vgap: 20 vgap: 20
}; };
} }
}); });
BI.shortcut("demo.select_tree_combo", Demo.SelectTreeCombo); BI.shortcut("demo.select_tree_combo", Demo.SelectTreeCombo);

48
demo/js/widget/singletree/demo.multilayer_single_tree_combo.js

@ -11,29 +11,31 @@ Demo.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
var items = BI.deepClone(Demo.CONSTANTS.TREE); var items = BI.deepClone(Demo.CONSTANTS.TREE);
return { return {
type: "bi.horizontal_auto", type: "bi.horizontal_auto",
items: [{ items: [
type: "bi.multilayer_single_tree_combo", {
ref: function (_ref) { type: "bi.multilayer_single_tree_combo",
self.tree = _ref; ref: function (_ref) {
}, self.tree = _ref;
defaultText: "请选择", },
items: items, defaultText: "请选择",
width: 300 items: items,
}, { width: 300
type: "bi.button", }, {
text: "getVlaue", type: "bi.button",
handler: function () { text: "getVlaue",
BI.Msg.toast(self.tree.getValue()[0]); handler: function () {
}, BI.Msg.toast(self.tree.getValue()[0]);
width: 300 },
}, { width: 300,
type: "bi.button", }, {
text: "setVlaue (第二级文件1)", type: "bi.button",
handler: function () { text: "setVlaue (11)",
self.tree.setValue(["第二级文件1"]); handler: function () {
}, self.tree.setValue(["11"]);
width: 300 },
}], width: 300
}
],
vgap: 20 vgap: 20
}; };
} }

Loading…
Cancel
Save