From 66544d73be7b643eda8d03b53b5a6763760dec99 Mon Sep 17 00:00:00 2001 From: zsmj Date: Thu, 9 Feb 2023 17:19:24 +0800 Subject: [PATCH] update demo --- .../demo.multilayer_select_tree_combo.js | 50 +++++++++--------- .../selecttree/demo.select_tree_combo.js | 52 ++++++++++--------- .../demo.multilayer_single_tree_combo.js | 48 +++++++++-------- 3 files changed, 78 insertions(+), 72 deletions(-) diff --git a/demo/js/widget/selecttree/demo.multilayer_select_tree_combo.js b/demo/js/widget/selecttree/demo.multilayer_select_tree_combo.js index 25ac4e518..e9ddefe5f 100644 --- a/demo/js/widget/selecttree/demo.multilayer_select_tree_combo.js +++ b/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 }; } diff --git a/demo/js/widget/selecttree/demo.select_tree_combo.js b/demo/js/widget/selecttree/demo.select_tree_combo.js index 1862340ab..e704e1f8a 100644 --- a/demo/js/widget/selecttree/demo.select_tree_combo.js +++ b/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); \ No newline at end of file +BI.shortcut("demo.select_tree_combo", Demo.SelectTreeCombo); diff --git a/demo/js/widget/singletree/demo.multilayer_single_tree_combo.js b/demo/js/widget/singletree/demo.multilayer_single_tree_combo.js index 1a699c2ea..42d60420e 100644 --- a/demo/js/widget/singletree/demo.multilayer_single_tree_combo.js +++ b/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 }; }