Skip to content

Commit

Permalink
feat(service): add more commonly used functions
Browse files Browse the repository at this point in the history
  • Loading branch information
ghiscoding committed Jul 22, 2018
1 parent 982de13 commit 88a0c07
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion aurelia-slickgrid/src/aurelia-slickgrid/services/grid.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ export class GridService {
}

/**
* Add an item (data item) to the datagrid
* Add an item (data item) to the datagrid, by default it will highlight (flashing) the inserted row but we can disable it too
* @param object dataItem: item object holding all properties of that row
* @param shouldHighlightRow do we want to highlight the row after adding item
*/
Expand All @@ -246,6 +246,17 @@ export class GridService {
this._dataView.refresh();
}

/**
* Add item array (data item) to the datagrid, by default it will highlight (flashing) the inserted row but we can disable it too
* @param dataItem array: item object holding all properties of that row
* @param shouldHighlightRow do we want to highlight the row after adding item
*/
addItemsToDatagrid(items: any[], shouldHighlightRow = true) {
if (Array.isArray(items)) {
items.forEach((item: any) => this.addItemToDatagrid(item, shouldHighlightRow));
}
}

/**
* Delete an existing item from the datagrid (dataView)
* @param object item: item object holding all properties of that row
Expand Down

0 comments on commit 88a0c07

Please sign in to comment.