Hi.
When i create grid like this:
let localeGrid = new Grid({
locale: 'pl', .....pageSettings: {
pageCount: 5,
pageSizes: [5, 10, 50, 'All'],
pageSize: 10,
}, ....
It works but when we choose "All" option in page selector data will not refresh, wee have spinner on grid and nothing happens.
In my language, "All" spells "Wszystko"
When i change line :
pageSizes: [5, 10, 50, 'All'],
pageSizes: [5, 10, 50, 'Wszystko'],
Pager should work on "All" option and only show translated name.
Wee could make something like :
let allName = GetFromTranslator('All') ;
pageSizes: [5, 10, 50, allName],
But i think is unnecessary complication.
L10n.load({
'pl': {
'pager': {
. . . . . . . . .
. . . . . . . . .
'All': 'Wszystko'
}
}
});
let grid: Grid = new Grid(
{
dataSource: orderData,
allowPaging: true,
height: 365,
locale: 'pl',
columns: [
. . . . . . . .
. . . . . . . .
],
pageSettings: { pageCount: 2, pageSizes: ["5", "12", "10", "Wszystko"] }
});
grid.appendTo('#Grid'); |
let grid: Grid = new Grid({
dataSource: orderData,
allowPaging: true,
height: 365,
locale: "pl",
columns: [
. . . . .
. . . . .
],
pageSettings: { pageCount: 2, pageSizes: ["5", "12", "10", "All"] }
}); |
let updateTemplate: Function = () => {
let drop: DropDownList;
drop = new DropDownList({
dataSource: data,
// maps the appropriate column to fields property
fields: { text: "text", value: "value" },
popupWidth: "250px",
change: args => {
var grid = (document.getElementsByClassName("e-grid")[0] as any)
.ej2_instances[0];
if (args.itemData.value == "All") {
grid.pageSettings.pageSize = grid.dataSource.length;
} else {
grid.pageSettings.pageSize = args.itemData.value;
}
}
});
drop.appendTo("#currentPage");
};
let flag: boolean = true;
let grid: Grid = new Grid({
dataSource: orderData,
allowPaging: true,
height: 365,
locale: "pl",
actionComplete: function(args) {
if (args.requestType === "paging") {
updateTemplate();
}
},
pageSettings: { template: "#template", pageSize: 7 },
dataBound: function() {
if (flag) {
flag = false;
updateTemplate();
}
},
columns: [
. . . . .
. . . . .
]
});
grid.appendTo("#Grid");
|