-
@minhhungit I am using a below code from your sliderevealdialog sample for next previous button. the only issue I am facing is while loading unsaved detail dialog with option of next and previous.. as the db entity id not available in this case loadByIdAndOpenDialog will not work.. can you please suggest possible solution to make this work for memorygrid. Thanks onClick: () => {
let grid = this.parentGrid;
let self = this;
(function next(loadedNewPage?: boolean): void {
let listIds = grid.view.getItems().map(x => x[(grid as any).getIdProperty()]);
if (grid !== null && typeof grid !== 'undefined') {
if (loadedNewPage) {
let nextId = listIds[0];
self.loadByIdAndOpenDialog(nextId);
}
else {
let currentEntityId = self.entityId;
if (currentEntityId !== null && typeof currentEntityId !== 'undefined') {
let listIds = grid.view.getItems().map(x => x[(grid as any).getIdProperty()]);
let currentIdIndex = listIds.indexOf(currentEntityId);
if (currentIdIndex >= listIds.length - 1) {
var btnNext = Q.first(buttons, x => x.title == "Next");
btnNext.disabled = true;
}
else {
let nextId = listIds[currentIdIndex + 1];
self.loadByIdAndOpenDialog(nextId);
}
}
}
}
})(); |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
sorry I have no idea at this time, these days are my holiday, happy Lunar new year |
Beta Was this translation helpful? Give feedback.
-
Changed else block as follows and it works let nextId = listIds[currentIdIndex + 1];
let nextentity = Q.tryFirst(grid.view.getItems(), x => x[(grid as any).getIdProperty()] == nextId);
self.loadEntityAndOpenDialog(nextentity) |
Beta Was this translation helpful? Give feedback.
Changed else block as follows and it works