Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Ng-dirty class for a control that was not touched
Message
From
07/03/2015 04:44:54
 
General information
Forum:
Javascript
Category:
Other
Miscellaneous
Thread ID:
01616375
Message ID:
01616391
Views:
27
>Hi everybody,
>
>I am seeing a strange behavior in one of our forms. Basically, after we just open a form to view and then try to navigate to another row, we're getting a message about unsaved changes. I identified the problematic control and inspecting the element returns
>
><data-sm:date-time-picker ng-model="currentLiabilityForm.expDate" is-date-range="false" 
>form="form.editLiabilityForm" name="expDate" ng-show="currentLiabilityForm.expStatic" 
>ng-required="currentLiabilityForm.expStatic" 
>class="ng-untouched ng-valid ng-isolate-scope ng-valid-required ng-dirty ng-valid-parse ng-valid-daterange" required="required">
><div class="input-group">
>    <input type="text" autocomplete="off" id="expDate" name="expDate" class="form-control ng-valid" placeholder="">
>    <span class="input-group-addon datepickerbutton">
>        <!--datepickerbutton:jquery datetimepicker plugin requires this class-->
>        <i class="fa fa-calendar"></i>
>    </span>
>    <!-- ngIf: showBod -->
>    <!-- ngIf: showEod -->
>    <!-- ngIf: showNow -->
></div>
><div class="field-validation-error">
>    <span ng-show="!validStartDateRange()" class="ng-hide">Start date must begin before end date.</span>
>    <span ng-show="!validEndDateRange()" class="ng-hide">End date must begin after start date.</span>
>    <span ng-show="!validRequired()" class="ng-hide">Date is required.</span>
>    <span ng-show="!validFutureDate()" class="ng-hide">Date must be in the future.</span>
>    <span ng-show="!validPastDate()" class="ng-hide">Date must be in the past.</span>
></div></data-sm:date-time-picker>
>
>
>Note ng-dirty class among other classes. What may cause this weird behavior, do you know?
>
>This is that control in HTML markup:
>
>
><div class="form-group" ng-show="currentLiabilityForm.expStatic">
>            <label class="control-label col-md-3 col-lg-3">@Labels.expirationDate: </label>
>            <div class="col-lg-4">
>                <data-sm:date-time-picker ng-model="currentLiabilityForm.expDate"
>                                          is-date-range="false"
>                                          form="form.editLiabilityForm"
>                                          
>                                          name="expDate"
>                                          ng-show="currentLiabilityForm.expStatic"
>                                          ng-required="currentLiabilityForm.expStatic">
>                </data-sm:date-time-picker>
>            </div>
>            <div class="field-validation-error">
>                <span ng-show="form.editLiabilityForm.expDate.$error.required 
>                      && form.editLiabilityForm.expDate.$dirty">@String.Format(Messages.isRequired, Labels.expirationDate)</span>
>            </div>
>        </div>
>
>Thanks in advance.

Nothing weird. You're flagging it as ditry in the markup so what do you expect......
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform