}
this.itemService.scannedItems.forEach((item, idx) => {
if (item.id() === updatedCopy.id()) {
+ // Retain the original grid index value so row
+ // selection can persist.
+ updatedCopy._index = item._index;
this.itemService.scannedItems.splice(idx, 1, updatedCopy);
}
});
});
}
+ // In fetchOnly mode, item data is fetched but not added directly to
+ // the grid.
getItemById(id: number, fetchOnly?: boolean): Promise<any> {
const flesh = {
.toPromise().then(item => {
this.mungeIsbns(item);
this.selectInput();
- item._index = ItemStatusComponent.rowIndex++;
if (!fetchOnly) {
+ item._index = ItemStatusComponent.rowIndex++;
if (this.tab === 'list') {
this.itemService.scannedItems.unshift(item);
} else {
}
return this.getItemCirc(item).then(_ => {
- if (this.grid) {
+ if (this.grid && !fetchOnly) {
this.grid.reload();
}
-
return item;
});
});