- Home
- Forum
- Angular - EJ 2
- ejs-grid Error on destroy
ejs-grid Error on destroy
Hi,
On the recent version of ej2-angular-grids, I'm noticing that the grid throws an error on destruction i.e when you navigate away from the page for example.
In my case, I've simply just created a grid, whose dataSource is bound to a hardcoded array in the component.ts file.
The grid displays the data without issue, but when the component is being destroyed, it throws as seen in the attached file. Although the attached project doesn't do much, it does have an effect on persisting filters in a larger sample that I've tried. In the attached code, I've got a simple grid, that you can toggle on or off so that you can see the error.
Attachment: grid_error_on_destroy_43009113.zip
Hi,
Thanks for the prompt response. Glad to hear there's a fix on the way.
In the meantime, is there a way to manually trigger the filter persistence logic to localStorage?
Kind regards
Rajapandi R
Apologies for the late response.
Thanks for the useful info! With this, I'll manually save the data on the destroy lifecycle hook until the patch is released.
Thanks. I also just want to point out that your persistency does not work when upgrading to v19.2.49.
It stores the props in the localstorage, but filtering and sorting column arrays are empty all the time.
Kind regards
Hi,
Please ignore my previous post.
So is the issue that I initially logged in this call resolved? Meaning that when navigating away from the page, the persistency will now work? Or is it for the patch still due the August 4th 2021 as per your initial response?
Kind regards
Just to follow up on the main issue that I logged this ticket for.
I've forked your stackblitz sample and enabled persistency.
Just to simulate paging, I've added a toggle display button that removes/adds the ej2-grid on the DOM.
When you refresh the page, the filters, sorting is stored as expected, but when clicking on the toggle button, you will see that it does not save filters and sorting.
https://stackblitz.com/edit/angular-c8eq6e-zdqczf?file=app.component.html
Kind regards
|
|
Hi,
I think there might be some misunderstanding. The previous stackblitz sample was to indicate that it does not persist data when destroyed (simulating navigating to another route).
Let me rather number the questions:
- When enabling persistency in the grid with [enablePersistence]="true", the grid should automatically store the filtering, sorting and paging in the localstorage, without really needing extra coding logic in the component. I'm I right on this one?
- If so, then why does it not work in this very basic app in the link below. What you will find is a simple app with 2 pages, namely grid-page and other-page routes. You will see the 2 links. The grid-page shows a page with the syncfusion grid (with [enablePersistence]="true") and the other page just returns some markup. What I'm seeing is that when I apply some filtering and some sorting and then navigate to other-page, it does not persist the filters and sorting in localstorage. Is this the intended functionality for [enablePersistence]="true"? I could have sworn I had no such issues in an earlier version when I tried out the grid.
- So changing the route does not persist data, but when I refresh the in app stackblitz browser after applying some filters, only then does it persist all the filters and sorting in local storage. Why does it only persist data when you refresh the page but not when navigating to another route?
Thanks. I'll be eagerly awaiting your feedback since this is one of the best features of the grid.
Just for extra proof, here's the exact same sample, but with version @~18 instead of 19 which shows that it works.
https://stackblitz.com/edit/angular-ivy-7rh8vg?file=src/app/app.component.ts
Many thanks for the response. I'll be awaiting the fix.
Kind regards
Thanks for the update!
Can't wait to test it out. I'll revert back once I've tested this.
Kind regards
- 19 Replies
- 3 Participants
-
VL VladimortZA
- Jul 21, 2021 07:04 AM UTC
- Sep 2, 2021 04:05 AM UTC