Set k-min to other controls value (Angular)

4 posts, 0 answers
  1. Elliot
    Elliot avatar
    59 posts
    Member since:
    May 2012

    Posted 16 Jun 2015 Link to this post

    I have two date pickers and want to set the min of the second equal to the value of the first however it is not applying the restriction.  Here are my two pickers:

    <input id="fromDate" name="toDate" kendo-date-picker k-ng-model="vm.fromDate" placeholder="From Date" />

    <input id="toDate" name="toDate" kendo-date-picker k-ng-model="vm.toDate" k-min="vm.fromDate" placeholder="To Date" />

  2. Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2565 posts

    Posted 18 Jun 2015 Link to this post

    Hi,

    If you want to update the widget when options change you will need to use a special directive. It is explained here:

    http://docs.telerik.com/kendo-ui/AngularJS/introduction#updating-widgets-when-options-change

    Regards,
    Kiril Nikolov
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  3. Kendo UI is VS 2017 Ready
  4. Elliot
    Elliot avatar
    59 posts
    Member since:
    May 2012

    Posted 18 Nov 2015 Link to this post

    I am still having an issue with this.  The link above no longer works but I did read the section on k-rebind and have added it to the toDate field but am getting a Uncaught TypeError: Cannot read property 'getMonth' of null error when it brings up the calendar on that field.

    The toDate input now looks like:

    <input id="toDate" name="toDate" kendo-date-picker k-ng-model="vm.toDate" k-min="vm.fromDate" k-rebind="vm.fromDate" placeholder="To Date" />

    How can I use k-min using another date pickers value?

  5. Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2565 posts

    Posted 19 Nov 2015 Link to this post

    Hi Elliot,

    The following k-rebind example seems to be working correctly:

    http://dojo.telerik.com/AneQe

    On a side note you can update the min setting using the widget API as well:


    http://docs.telerik.com/kendo-ui/api/javascript/ui/numerictextbox#methods-min

    Regards,
    Kiril Nikolov
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
Back to Top
Kendo UI is VS 2017 Ready