From b1f528b544479063e7c285fc447a08c4c126c8c4 Mon Sep 17 00:00:00 2001 From: guy Date: Fri, 24 Mar 2017 14:34:04 +0800 Subject: [PATCH] add --- demo/js/config/core.js | 24 ++++++++++++------------ dist/base.js | 19 +++++++------------ src/base/combination/group.virtual.js | 19 +++++++------------ 3 files changed, 26 insertions(+), 36 deletions(-) diff --git a/demo/js/config/core.js b/demo/js/config/core.js index 4a6131367..05f334a53 100644 --- a/demo/js/config/core.js +++ b/demo/js/config/core.js @@ -93,6 +93,18 @@ Demo.CORE_CONFIG = [{ pId: 102, text: "bi.virtual_group", value: "demo.virtual_group" +}, { + pId: 102, + text: "bi.custom_tree", + value: "demo.custom_tree" +}, { + pId: 102, + text: "bi.grid_view", + value: "demo.grid_view" +}, { + pId: 102, + text: "bi.collection_view", + value: "demo.collection_view" }, { pId: 102, id: 10201, @@ -145,18 +157,6 @@ Demo.CORE_CONFIG = [{ pId: 10202, text: "bi.layer_searcher", value: "demo.layer_searcher" -}, { - pId: 102, - text: "bi.custom_tree", - value: "demo.custom_tree" -}, { - pId: 102, - text: "bi.grid_view", - value: "demo.grid_view" -}, { - pId: 102, - text: "bi.collection_view", - value: "demo.collection_view" }, { pId: 1, text: "widget", diff --git a/dist/base.js b/dist/base.js index 387e75066..115ef4340 100644 --- a/dist/base.js +++ b/dist/base.js @@ -3565,26 +3565,21 @@ $.shortcut("bi.combo_group", BI.ComboGroup);BI.VirtualGroup = BI.inherit(BI.Widg this.populate(this.options.items); }, - _createBtns: function (items) { - var o = this.options; - return BI.createItems(items, { - type: "bi.text_button" - }); - }, - - _packageBtns: function (btns) { + _packageBtns: function (items) { var o = this.options; for (var i = o.layouts.length - 1; i > 0; i--) { - btns = BI.map(btns, function (k, it) { + items = BI.map(items, function (k, it) { return BI.extend({}, o.layouts[i], { items: [ - BI.extend({}, o.layouts[i].el, it) + BI.extend({}, o.layouts[i].el, { + el: BI.stripEL(it) + }) ] }) }) } - return btns; + return items; }, _packageItems: function (items, packBtns) { @@ -3606,7 +3601,7 @@ $.shortcut("bi.combo_group", BI.ComboGroup);BI.VirtualGroup = BI.inherit(BI.Widg var self = this; items = items || []; this.options.items = items; - items = this._packageItems(items, this._packageBtns(this._createBtns(items))); + items = this._packageItems(items, this._packageBtns(items)); if (!this.layouts) { this.layouts = BI.createWidget(BI.extend({element: this}, this._packageLayout(items))); } else { diff --git a/src/base/combination/group.virtual.js b/src/base/combination/group.virtual.js index 3f4de579d..ceef16e3e 100644 --- a/src/base/combination/group.virtual.js +++ b/src/base/combination/group.virtual.js @@ -15,26 +15,21 @@ BI.VirtualGroup = BI.inherit(BI.Widget, { this.populate(this.options.items); }, - _createBtns: function (items) { - var o = this.options; - return BI.createItems(items, { - type: "bi.text_button" - }); - }, - - _packageBtns: function (btns) { + _packageBtns: function (items) { var o = this.options; for (var i = o.layouts.length - 1; i > 0; i--) { - btns = BI.map(btns, function (k, it) { + items = BI.map(items, function (k, it) { return BI.extend({}, o.layouts[i], { items: [ - BI.extend({}, o.layouts[i].el, it) + BI.extend({}, o.layouts[i].el, { + el: BI.stripEL(it) + }) ] }) }) } - return btns; + return items; }, _packageItems: function (items, packBtns) { @@ -56,7 +51,7 @@ BI.VirtualGroup = BI.inherit(BI.Widget, { var self = this; items = items || []; this.options.items = items; - items = this._packageItems(items, this._packageBtns(this._createBtns(items))); + items = this._packageItems(items, this._packageBtns(items)); if (!this.layouts) { this.layouts = BI.createWidget(BI.extend({element: this}, this._packageLayout(items))); } else {