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

pbl-ngrid throwing error when changing pages on Angular project. #215

Open
pasaku opened this issue Oct 27, 2021 · 2 comments
Open

pbl-ngrid throwing error when changing pages on Angular project. #215

pasaku opened this issue Oct 27, 2021 · 2 comments

Comments

@pasaku
Copy link

pasaku commented Oct 27, 2021

Current error message showing is this while changing pages:

TypeError: Cannot read properties of undefined (reading 'prev' ... pebula-ngrid.js:4164

On line 4167, could you please add an Elvis Operator here before 'prev' and 'current':

this.focusChanged = this.focusChanged$
            .pipe(buffer(this.focusChanged$.pipe(debounceTime(0, asapScheduler))), map(events => ({ prev: events[0]?.prev, curr: events[events.length - 1]?.curr })));

#angular12

@Al00X
Copy link

Al00X commented Nov 29, 2021

bump, I have this issue too.
Thanks in advance.

@Al00X
Copy link

Al00X commented Feb 2, 2022

Ok after months with no response from devs, I managed to monkey patch it till they fix it.
Solution:

// Temporary fix for error: reading property of undefined, "prev"
setTimeout(() => {
      const originalDestroy = this.table._extApi.contextApi.destroy;
      this.table._extApi.contextApi.destroy = () => {
        try {
          originalDestroy();
        } catch {}
      };
    }, 1);

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

Successfully merging a pull request may close this issue.

2 participants