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);
return {
type: "bi.horizontal_auto",
items: [{
type: "bi.multilayer_select_tree_combo",
ref: function (_ref) {
self.tree = _ref;
},
defaultText: "请选择",
items: items,
width: 300,
value: ["第五级文件1"]
}, {
type: "bi.button",
text: "getVlaue",
handler: function () {
BI.Msg.toast(self.tree.getValue()[0]);
},
width: 300
}, {
type: "bi.button",
text: "setVlaue (第二级文件1)",
handler: function () {
self.tree.setValue(["第二级文件1"]);
},
width: 300
}],
items: [
{
type: "bi.multilayer_select_tree_combo",
ref: function (_ref) {
self.tree = _ref;
},
defaultText: "请选择",
items: items,
width: 300,
value: ["第五级文件1"]
}, {
type: "bi.button",
text: "getVlaue",
handler: function () {
BI.Msg.toast(self.tree.getValue()[0]);
},
width: 300
}, {
type: "bi.button",
text: "setVlaue (第二级文件1)",
handler: function () {
self.tree.setValue(["11"]);
},
width: 300
}
],
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);
return {
type: "bi.horizontal_auto",
items: [{
type: "bi.select_tree_combo",
ref: function (_ref) {
self.tree = _ref;
},
value: "11",
text: "默认值",
items: items,
width: 300
}, {
type: "bi.button",
text: "getVlaue",
handler: function () {
BI.Msg.toast(self.tree.getValue()[0]);
},
width: 300
}, {
type: "bi.button",
text: "setVlaue (第二级文件1)",
handler: function () {
self.tree.setValue(["2"]);
},
width: 300
}],
items: [
{
type: "bi.select_tree_combo",
ref: function (_ref) {
self.tree = _ref;
},
value: "11",
text: "默认值",
items: items,
width: 300
}, {
type: "bi.button",
text: "getVlaue",
handler: function () {
BI.Msg.toast(self.tree.getValue()[0]);
},
width: 300
}, {
type: "bi.button",
text: "setVlaue (11)",
handler: function () {
self.tree.setValue(["2"]);
},
width: 300
}
],
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);
return {
type: "bi.horizontal_auto",
items: [{
type: "bi.multilayer_single_tree_combo",
ref: function (_ref) {
self.tree = _ref;
},
defaultText: "请选择",
items: items,
width: 300
}, {
type: "bi.button",
text: "getVlaue",
handler: function () {
BI.Msg.toast(self.tree.getValue()[0]);
},
width: 300
}, {
type: "bi.button",
text: "setVlaue (第二级文件1)",
handler: function () {
self.tree.setValue(["第二级文件1"]);
},
width: 300
}],
items: [
{
type: "bi.multilayer_single_tree_combo",
ref: function (_ref) {
self.tree = _ref;
},
defaultText: "请选择",
items: items,
width: 300
}, {
type: "bi.button",
text: "getVlaue",
handler: function () {
BI.Msg.toast(self.tree.getValue()[0]);
},
width: 300,
}, {
type: "bi.button",
text: "setVlaue (11)",
handler: function () {
self.tree.setValue(["11"]);
},
width: 300
}
],
vgap: 20
};
}

Loading…
Cancel
Save