fineui是帆软报表和BI产品线所使用的前端框架。
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

87 lines
2.6 KiB

import { shortcut, Widget, map, range, deepClone } from "@/core";
import { ButtonGroup } from "@/base";
8 years ago
@shortcut()
export class Func extends Widget {
static xtype = "demo.virtual_group";
props = { baseCls: "demo-func" };
_createItems() {
const items = map(range(1000), i => {
7 years ago
return {
type: "demo.virtual_group_item",
7 years ago
value: i,
key: i + 1,
7 years ago
};
8 years ago
});
8 years ago
return items;
}
render() {
const self = this;
const buttonGroupItems = self._createItems();
const virtualGroupItems = self._createItems();
8 years ago
return {
type: "bi.vertical",
vgap: 20,
items: [
{
type: "bi.label",
cls: "layout-bg5",
height: 50,
text: "共1000个元素,演示button_group和virtual_group每次删除第一个元素,打开控制台看输出",
7 years ago
},
{
type: "bi.button_group",
width: 500,
height: 300,
ref() {
self.buttonGroup = this;
},
chooseType: ButtonGroup.CHOOSE_TYPE_MULTI,
layouts: [
{
type: "bi.vertical",
}
],
items: this._createItems(),
},
{
type: "bi.button",
text: "演示button_group的刷新",
handler() {
buttonGroupItems.shift();
self.buttonGroup.populate(deepClone(buttonGroupItems));
},
8 years ago
},
{
type: "bi.virtual_group",
width: 500,
height: 300,
ref() {
self.virtualGroup = this;
},
chooseType: ButtonGroup.CHOOSE_TYPE_MULTI,
layouts: [
{
type: "bi.vertical",
}
],
items: this._createItems(),
},
{
type: "bi.button",
text: "演示virtual_group的刷新",
handler() {
virtualGroupItems.shift();
self.virtualGroup.populate(deepClone(virtualGroupItems));
},
8 years ago
}
],
7 years ago
};
8 years ago
}
}