本文整理汇总了TypeScript中jui-grid.GridXTable类的典型用法代码示例。如果您正苦于以下问题:TypeScript GridXTable类的具体用法?TypeScript GridXTable怎么用?TypeScript GridXTable使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了GridXTable类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: xtable
jui.ready([ "grid.xtable" ], (xtable: GridXTable) => {
const xtable_4: GridXTable = xtable("#xtable_4", {
fields: [ "name", "age", "location" ],
data: [
{ name: "Hong", age: "20", location: "Ilsan" },
{ name: "Jung", age: "30", location: "Seoul" },
{ name: "Park", age: "10", location: "Dangjin" }
],
resize: true,
sort: true,
buffer: "s-page",
bufferCount: 20
});
const xtable_4_submit: Function = (isMulti: boolean) => {
if (isMulti) {
xtable_4.filter((data: any) => {
if (data.age >= 30 || data.name.indexOf("ng") !== -1) {
return true;
}
});
} else {
xtable_4.filter((data: any) => {
if (data.location.indexOf("eo") !== -1) {
return true;
}
});
}
};
});
示例2:
const xtable_2_submit: Function = () => {
const result: any[] = [];
for (let i = 0; i < 1000000; i++) {
result.push({ name: "Alvin" + i, age: Math.floor(Math.random() * 100) + 1, location: "LA" });
}
page = 1;
xtable_2.update(result);
xtable_2.resize();
};