Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
By-passing $dirty check
Message
 
 
À
01/04/2015 07:06:01
Information générale
Forum:
Javascript
Catégorie:
Autre
Divers
Thread ID:
01609780
Message ID:
01617592
Vues:
21
>>>Why did you change from onblur to focus ?
>>
>>By investigating it a bit more I found that in the "working" form changing controls in the views that are supposed to trigger dirty state and don't have the no-dirty-check directive applied still don't make the form $dirty = true. So, it's a two-fold problem now.
>
>Not sure what you have wrong. Your binding syntax in the directive didn't work for me but this does:
element.bind('blur', function () {
>ctrl.$setPristine();
> scope.$apply();
> })(scope.$apply() just there to update any validation markings)
Thanks, Viv, I'll try that. I was also getting errors when I tried onblur.

My problem is quite complex in that form. If I make a change in a page, then immediately try to switch to a different row from the parent form or go to another menu, I get a question about changes, so that's good. But if I make a change, switch to another tab in that form, then return to the same tab and try to go to another menu, I don't get the question and the dirty state of the form is lost.

So, this is one problem with the technique we're using of switching tabs.

However, it gets even more weird. If from the invoices list tab I go inside the invoice edit form, try to change search text (which has noDirtyCheck directive) on the Transactions page, then try to go to another tab within that invoice edit form, I get a prompt. I can answer that I don't care about changes, switch again, then back to transactions, then back to another tab and I again get the same prompt. In other words, in this particular case the dirty state remains and the form should not have been made dirty in the first place because I have this directive.

So, that are my problems with that particular complex form. Yesterday I thought I'll try to fix the problem with Transactions page quickly and switch to a different task (calling C# static method from VFP). Instead I spent several hours in that form with 0 success. This is quite frustrating.... :(
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform