Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updateItemById refresh all the grid #715

Closed
bzhjack opened this issue Mar 15, 2021 · 2 comments
Closed

updateItemById refresh all the grid #715

bzhjack opened this issue Mar 15, 2021 · 2 comments
Labels

Comments

@bzhjack
Copy link

bzhjack commented Mar 15, 2021

I'm submitting a Bug report

using dataView.onRowsOrCountChanged instead of dataView.onRowCountChanged to refresh metrics this refreshes the whole grid in the case of an updateItemById.

Your Environment

Software Version(s)
Angular 8.3
Angular-Slickgrid 2.26.1
TypeScript 3.5.3

Describe the Bug

before

     this._eventHandler.subscribe(dataView.onRowCountChanged, (_e: Event, args: any) => {

now

      this._eventHandler.subscribe(dataView.onRowsOrCountChanged, (_e: Event, args: any) => {

Steps to Reproduce

i noticed this using updateItemById to in a sgOnCellChange

onCellChanged(e, args) {
    const metadata = this.angularGrid.gridService.getColumnFromEventArguments(args);
    if (metadata.columnDef.id === 'quantity') {
      const goodRec = findTabLinesById(this.tabLines, metadata.dataContext.id);
      if (goodRec) {
       goodRec.disable = true;
         this.angularGrid.gridService.updateItemById(goodRec.id, goodRec);
      }
    }
}

Expected Behavior

Refresh only the current line involve by the updateItemById

Current Behavior

the whole grid is refreshed and this leads to the exit of the edition of the next cell

@ghiscoding
Copy link
Owner

I had made that change because in our use case the metrics weren't refreshed after changing the dataset but I found out later that I can use 2 events to take care of the metrics count for all the use case, that would be reverting back to the previous onRowCountChanged and the also use the onSetItemsCalled event to refresh the metrics, the latter was the one I needed to cover my use case. I'll rework that shortly.

@ghiscoding
Copy link
Owner

@bzhjack
This is now released with a few other new features, refer to the new release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants