Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I've created a custom backoffice plug-in that uses an html table presentation for listing rows of data.
To make it a bit more functional, I added a basic filter, where there is a text-box with a ng-change and ng-model, that updates the filter:model of the ng-repeat on the table rows. Very basic, but works well enough to be useful.
However, when I go to leave the node using the plug-in, Umbraco insists on nagging me about having unsaved changes, even though the only changes are to the filter, and not to the tabular content itself... which is read-only.
Anyone got an idea on what triggers this status check, and how I can cancel it to stop the unnecessary and alarming alert ?
Can you show us some code. Your are problably setting the filter on the model...and so you are changing your model. This triggers umbraco to see it as dirty and will show the dialog.
Specifying a client-side filter from a textbox using ng-change="myHandler()" which requires that you specify ng-model="myFilterVar"
Then use as: tr ng-repeat="item in items | filter:myFilterVar"
I appreciate Umbraco has decided that a change to myFilterVar means the app is "dirty" but I know that's spurious, and just want to ignore or clear the dirty state.
I've seen this problem with a number of other plugins (not mine) where you'll use them to view/read info, only to have Umbraco throw an unsaved data alert when you exit, despite there being nothing you can change or save.
So, I found the answer to my own question, and it's documented... I just needed to understand where and what to look for.
There is an umbraco directive available "noDirtyCheck" and once I added it to my filter input it no longer flagged the model as dirty, and so stopped throwing an unsaved data alert on exit.
Yep...I actually use that myself....should have remembered it.
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted