Open imSurya-georgian opened 3 years ago
I would set a boolean to true when the grid changes.
Use canDeactivate on the route to prevent the user from leaving the page. Put a popup that asks the user if they want to save their changes.
Don't hit the database more than it needs to. You already know it's ideal to do this once during onDestroy but that's not guaranteed to work.
Thanks, @astone2014. I can implement something around canDeactivate property but I want to implement UI in such a way where user interaction is not needed to save the layout.
Hello @astone2014 , You could make a debounce on the Item Change and then make one request to backend with all the widgets that changed position or with all of them.
You can also use browser events, e.g.
But note that these are not 100% reliable - eg. on mobile
Undoubtedly this is an awesome package. Three different options i can think of in order to save.
Please let me know what could be the best approach or how you have implemented.