guy 8 years ago
parent
commit
b1f528b544
  1. 24
      demo/js/config/core.js
  2. 19
      dist/base.js
  3. 19
      src/base/combination/group.virtual.js

24
demo/js/config/core.js

@ -93,6 +93,18 @@ Demo.CORE_CONFIG = [{
pId: 102, pId: 102,
text: "bi.virtual_group", text: "bi.virtual_group",
value: "demo.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, pId: 102,
id: 10201, id: 10201,
@ -145,18 +157,6 @@ Demo.CORE_CONFIG = [{
pId: 10202, pId: 10202,
text: "bi.layer_searcher", text: "bi.layer_searcher",
value: "demo.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, pId: 1,
text: "widget", text: "widget",

19
dist/base.js vendored

@ -3565,26 +3565,21 @@ $.shortcut("bi.combo_group", BI.ComboGroup);BI.VirtualGroup = BI.inherit(BI.Widg
this.populate(this.options.items); this.populate(this.options.items);
}, },
_createBtns: function (items) { _packageBtns: function (items) {
var o = this.options;
return BI.createItems(items, {
type: "bi.text_button"
});
},
_packageBtns: function (btns) {
var o = this.options; var o = this.options;
for (var i = o.layouts.length - 1; i > 0; i--) { 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], { return BI.extend({}, o.layouts[i], {
items: [ 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) { _packageItems: function (items, packBtns) {
@ -3606,7 +3601,7 @@ $.shortcut("bi.combo_group", BI.ComboGroup);BI.VirtualGroup = BI.inherit(BI.Widg
var self = this; var self = this;
items = items || []; items = items || [];
this.options.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) { if (!this.layouts) {
this.layouts = BI.createWidget(BI.extend({element: this}, this._packageLayout(items))); this.layouts = BI.createWidget(BI.extend({element: this}, this._packageLayout(items)));
} else { } else {

19
src/base/combination/group.virtual.js

@ -15,26 +15,21 @@ BI.VirtualGroup = BI.inherit(BI.Widget, {
this.populate(this.options.items); this.populate(this.options.items);
}, },
_createBtns: function (items) { _packageBtns: function (items) {
var o = this.options;
return BI.createItems(items, {
type: "bi.text_button"
});
},
_packageBtns: function (btns) {
var o = this.options; var o = this.options;
for (var i = o.layouts.length - 1; i > 0; i--) { 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], { return BI.extend({}, o.layouts[i], {
items: [ 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) { _packageItems: function (items, packBtns) {
@ -56,7 +51,7 @@ BI.VirtualGroup = BI.inherit(BI.Widget, {
var self = this; var self = this;
items = items || []; items = items || [];
this.options.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) { if (!this.layouts) {
this.layouts = BI.createWidget(BI.extend({element: this}, this._packageLayout(items))); this.layouts = BI.createWidget(BI.extend({element: this}, this._packageLayout(items)));
} else { } else {

Loading…
Cancel
Save