jQWidgets Forums

jQuery UI Widgets Forums Plugins AngularJS jqx-date-time-input and form.$pristine

This topic contains 3 replies, has 3 voices, and was last updated by  Peter Stoev 8 years, 11 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • jqx-date-time-input and form.$pristine #66167

    raulteixeira
    Participant

    I have a jqx-date-time-input inside a form element connected to a model object with ng-model. As soon as the page loads up, the form’s pristine property changes to “false”, without having changed the date. Upon further debugging, I noticed that as soon the controller loads up, jqx-date-time-input is initialized with the “current date”, but is immediately “changed” to the value binded by ng-model. This apparently causes the change in the form’s $pristine property.
    Here is a simple example that provokes the situation:

    HTML:

    <div ng-controller="dateCtrl">
        <h1>{{frm.$pristine}}</h1>
        <form name="frm">
            <label for="datetest">Date:</label>
            <jqx-date-time-input id="datetest" jqx-ng-model ng-model="date" ></jqx-date-time-input>
    
        </form>
    </div>
    

    JS

    kdpoc.controller('dateCtrl', ['$scope', '$timeout',
        function($scope, $timeout) {
            $scope.date = new Date(2014, 10, 10);
        }
    ]);
    
    jqx-date-time-input and form.$pristine #66168

    Peter Stoev
    Keymaster

    Hi raulteixeira,

    Actually this is an issue in our code. We’ll investigate it for the next release.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com


    timewaster
    Participant

    Hi Peter,

    This issue is not resolved in the current version of jqWidgets. The initialization from current date to the value bound by ng-model produces a flicker in the view. Are there any plans to resolve this in the near future?

    Thanks.
    -TW


    Peter Stoev
    Keymaster

    Hi TW,

    This is minor low priority item in our list.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com/

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.