Browse Source

update

master
guy 7 years ago
parent
commit
f5c5781412
  1. 4
      bi/base.js
  2. 6
      bi/core.js
  3. 32
      demo/js/core/abstract/demo.virtual_group.js
  4. 4
      dist/base.js
  5. 10
      dist/bundle.js
  6. 6
      dist/core.js
  7. 32
      dist/demo.js
  8. 4
      src/base/combination/group.virtual.js
  9. 4
      src/core/wrapper/layout.js
  10. 2
      src/core/wrapper/layout/layout.horizontal.js

4
bi/base.js

@ -3904,10 +3904,6 @@ BI.shortcut("bi.combo_group", BI.ComboGroup);BI.VirtualGroup = BI.inherit(BI.Wid
return this.layouts.getValue();
},
empty: function () {
this.layouts.empty();
},
populate: function (items) {
var self = this;
items = items || [];

6
bi/core.js

@ -11527,9 +11527,9 @@ BI.Layout = BI.inherit(BI.Widget, {
})
},
update: function (item) {
update: function (opt) {
var o = this.options;
var items = item.items || [];
var items = opt.items || [];
var updated, i, len;
for (i = 0, len = Math.min(o.items.length, items.length); i < len; i++) {
if (!this._compare(o.items[i], items[i])) {
@ -13881,7 +13881,7 @@ BI.HorizontalLayout = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.HorizontalLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-horizontal-layout",
verticalAlign: "middle",
verticalAlign: BI.VerticalAlign.Top,
columnSize: [],
scrollx: true,
hgap: 0,

32
demo/js/core/abstract/demo.virtual_group.js

@ -4,7 +4,7 @@ Demo.Func = BI.inherit(BI.Widget, {
},
_createItems: function () {
var items = BI.makeArray(100, {
var items = BI.makeArray(1000, {
type: "demo.virtual_group_item"
});
items[0].value = BI.UUID();
@ -17,11 +17,33 @@ Demo.Func = BI.inherit(BI.Widget, {
type: "bi.vertical",
vgap: 20,
items: [{
type: "bi.button_group",
width: 500,
height: 300,
ref: function () {
self.buttonGroup = this;
},
chooseType: BI.ButtonGroup.CHOOSE_TYPE_MULTI,
layouts: [{
type: "bi.vertical"
}, {
type: "bi.center_adapt",
}],
items: this._createItems()
}, {
type: "bi.button",
text: "演示button_group的刷新",
handler: function () {
var items = self._createItems();
items.pop();
self.buttonGroup.populate(items);
}
}, {
type: "bi.virtual_group",
width: 500,
height: 300,
ref: function () {
self.buttonMap = this;
self.virtualGroup = this;
},
chooseType: BI.ButtonGroup.CHOOSE_TYPE_MULTI,
layouts: [{
@ -32,11 +54,11 @@ Demo.Func = BI.inherit(BI.Widget, {
items: this._createItems()
}, {
type: "bi.button",
text: "点击刷新",
text: "演示virtual_group的刷新",
handler: function () {
var items = self._createItems();
items.pop();
self.buttonMap.populate(items);
self.virtualGroup.populate(items);
}
}]
@ -66,7 +88,7 @@ Demo.Item = BI.inherit(BI.Widget, {
update: function (item) {
this.label.setText(item.value);
console.log("更新了一项");
return true;
return true;//返回是不是更新成功
},
created: function () {

4
dist/base.js vendored

@ -3904,10 +3904,6 @@ BI.shortcut("bi.combo_group", BI.ComboGroup);BI.VirtualGroup = BI.inherit(BI.Wid
return this.layouts.getValue();
},
empty: function () {
this.layouts.empty();
},
populate: function (items) {
var self = this;
items = items || [];

10
dist/bundle.js vendored

@ -19883,9 +19883,9 @@ BI.Layout = BI.inherit(BI.Widget, {
})
},
update: function (item) {
update: function (opt) {
var o = this.options;
var items = item.items || [];
var items = opt.items || [];
var updated, i, len;
for (i = 0, len = Math.min(o.items.length, items.length); i < len; i++) {
if (!this._compare(o.items[i], items[i])) {
@ -27440,7 +27440,7 @@ BI.HorizontalLayout = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.HorizontalLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-horizontal-layout",
verticalAlign: "middle",
verticalAlign: BI.VerticalAlign.Top,
columnSize: [],
scrollx: true,
hgap: 0,
@ -32775,10 +32775,6 @@ BI.shortcut("bi.combo_group", BI.ComboGroup);BI.VirtualGroup = BI.inherit(BI.Wid
return this.layouts.getValue();
},
empty: function () {
this.layouts.empty();
},
populate: function (items) {
var self = this;
items = items || [];

6
dist/core.js vendored

@ -19832,9 +19832,9 @@ BI.Layout = BI.inherit(BI.Widget, {
})
},
update: function (item) {
update: function (opt) {
var o = this.options;
var items = item.items || [];
var items = opt.items || [];
var updated, i, len;
for (i = 0, len = Math.min(o.items.length, items.length); i < len; i++) {
if (!this._compare(o.items[i], items[i])) {
@ -27389,7 +27389,7 @@ BI.HorizontalLayout = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.HorizontalLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-horizontal-layout",
verticalAlign: "middle",
verticalAlign: BI.VerticalAlign.Top,
columnSize: [],
scrollx: true,
hgap: 0,

32
dist/demo.js vendored

@ -6872,7 +6872,7 @@ BI.shortcut("demo.list_view", Demo.Func);Demo.Func = BI.inherit(BI.Widget, {
},
_createItems: function () {
var items = BI.makeArray(100, {
var items = BI.makeArray(1000, {
type: "demo.virtual_group_item"
});
items[0].value = BI.UUID();
@ -6885,11 +6885,33 @@ BI.shortcut("demo.list_view", Demo.Func);Demo.Func = BI.inherit(BI.Widget, {
type: "bi.vertical",
vgap: 20,
items: [{
type: "bi.button_group",
width: 500,
height: 300,
ref: function () {
self.buttonGroup = this;
},
chooseType: BI.ButtonGroup.CHOOSE_TYPE_MULTI,
layouts: [{
type: "bi.vertical"
}, {
type: "bi.center_adapt",
}],
items: this._createItems()
}, {
type: "bi.button",
text: "演示button_group的刷新",
handler: function () {
var items = self._createItems();
items.pop();
self.buttonGroup.populate(items);
}
}, {
type: "bi.virtual_group",
width: 500,
height: 300,
ref: function () {
self.buttonMap = this;
self.virtualGroup = this;
},
chooseType: BI.ButtonGroup.CHOOSE_TYPE_MULTI,
layouts: [{
@ -6900,11 +6922,11 @@ BI.shortcut("demo.list_view", Demo.Func);Demo.Func = BI.inherit(BI.Widget, {
items: this._createItems()
}, {
type: "bi.button",
text: "点击刷新",
text: "演示virtual_group的刷新",
handler: function () {
var items = self._createItems();
items.pop();
self.buttonMap.populate(items);
self.virtualGroup.populate(items);
}
}]
@ -6934,7 +6956,7 @@ Demo.Item = BI.inherit(BI.Widget, {
update: function (item) {
this.label.setText(item.value);
console.log("更新了一项");
return true;
return true;//返回是不是更新成功
},
created: function () {

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

@ -63,10 +63,6 @@ BI.VirtualGroup = BI.inherit(BI.Widget, {
return this.layouts.getValue();
},
empty: function () {
this.layouts.empty();
},
populate: function (items) {
var self = this;
items = items || [];

4
src/core/wrapper/layout.js

@ -347,9 +347,9 @@ BI.Layout = BI.inherit(BI.Widget, {
})
},
update: function (item) {
update: function (opt) {
var o = this.options;
var items = item.items || [];
var items = opt.items || [];
var updated, i, len;
for (i = 0, len = Math.min(o.items.length, items.length); i < len; i++) {
if (!this._compare(o.items[i], items[i])) {

2
src/core/wrapper/layout/layout.horizontal.js

@ -7,7 +7,7 @@ BI.HorizontalLayout = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.HorizontalLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-horizontal-layout",
verticalAlign: "middle",
verticalAlign: BI.VerticalAlign.Top,
columnSize: [],
scrollx: true,
hgap: 0,

Loading…
Cancel
Save