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,
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",

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);
},
_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 {

19
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 {

Loading…
Cancel
Save