本文整理匯總了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();
};