Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
By-passing $dirty check
Message
De
23/10/2014 12:24:26
 
 
Information générale
Forum:
Javascript
Catégorie:
Autre
Divers
Thread ID:
01609780
Message ID:
01609811
Vues:
33
This message has been marked as a message which has helped to the initial question of the thread.
>>>>>Hi everybody,
>>>>>
>>>>>I have a form with multiple tabs. One tab form has the following code right now
>>>>>
>>>>>
>>>>>ng-form name="editAccountInvoices">
>>>>>    <div class="checkbox" ng-show="!isNew">
>>>>>        <label>
>>>>>            <input type="checkbox" name="showFinalized" id="showFinalized"
>>>>>                   ng-model="showFinalized"
>>>>>                   />Show Finalized Invoices
>>>>>        </label>
>>>>>    </div>
>>>>>    <div id="_actions" class="padd">
>>>>>        <div class="gridStyle" ng-grid="gridOptions"></div>
>>>>>    </div>
>>>>></ng-form>
>>>>>
>>>>>
>>>>>I also plan to add the search textbox later on to be able to filter the grid's data.
>>>>>
>>>>>Now, apart from that ngGrid is not yet working with navigation I have another problem. When I click on the checkbox and when try to navigate away from that form, I get a prompt about data changes. I want to avoid this prompt as that checkbox is used only for filtering.
>>>>>
>>>>>Do you know how to solve that problem?
>>>>>
>>>>>I did a quick google search, but not too extensive and didn't find anything.
>>>>>
>>>>>Thanks in advance.
>>>>
>>>>Just put it outside the form....
>>>
>>>Do you mean above the ng-form tag? I'll try that but this form is part of the main editForm which has at the top
>>>
>>>
>>><form name="form" novalidate role="form" 
>>>          data-sm:dirty-check data-server:error ng-show="showForm" class="ng-cloak">
>>>
>>>and the form I showed is used as a tab
>>>
>>>
>>><div class="tab-pane" id="invoices">
>>>                                @Html.Partial("EditAccountInvoices")
>>>                            </div>
>>
>>If it doesn't work look at the options here : http://stackoverflow.com/questions/17089090/prevent-input-from-setting-form-dirty-angularjs
>
>From that page you pointed me to I like the directive approach which I am going to implement. I think we may need this directive in some places in our application.

Looks like the best approach - although the point about setting it in .focus() is probably a good one...
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform