Skip to content

Commit

Permalink
fix(delete): deleteDataGridItemById should also work on row index 0
Browse files Browse the repository at this point in the history
  • Loading branch information
ghiscoding committed Apr 14, 2018
1 parent 1845ea9 commit af283f3
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ export class GridExtraService {
const row = this._dataView.getRowById(item.id);
const itemId = (!item || !item.hasOwnProperty('id')) ? -1 : item.id;

if (itemId === -1) {
if (row === undefined || itemId === -1) {
throw new Error(`Could not find the item in the grid or it's associated "id"`);
}

Expand All @@ -151,7 +151,7 @@ export class GridExtraService {
deleteDataGridItemById(id: string | number) {
const row = this._dataView.getRowById(id);

if (!row) {
if (row === undefined) {
throw new Error(`Could not find the item in the grid by it's associated "id"`);
}

Expand Down

0 comments on commit af283f3

Please sign in to comment.