This is a migrated thread and some comments may be shown as answers.

Angularjs date-time-picker binding issue

1 Answer 37 Views
Date/Time Pickers
This is a migrated thread and some comments may be shown as answers.
OMER
Top achievements
Rank 1
OMER asked on 11 Dec 2014, 02:05 PM
I have 2 issues with this widget:
1) http://dojo.telerik.com/avAQe - when I set the date from the controller, the "str" is empty (e.g. no ng-model). If you comment out the $scope.obj = new Date();, it works fine...
2) This might be related. When my SPA initiates, I inhabit the model in a directive. This reflects in the widget only after I reload the view (e.g. by routing to another view and coming back, using angularjs core routing).
I'm using angularjs 1.2.27 and the latest kendoui (Q3 2014).

1 Answer, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 15 Dec 2014, 09:48 AM
Hello OMER,

The widget will not update all of its bindings when one is change from the scope. That being said, you will need to keep your scope synced if some of the fields are updated manually:
$scope.obj = new Date();
$scope.str = kendo.toString($scope.obj, "MM/dd/yyyy hh:mm tt");
Here is the updated demo.

With regards to the second question, I am afraid that I cannot quite understand what is the erroneous behavior and what is causing it. Could you provide a Dojo demo that we can review?

Let me know if I am missing something.

Regards,
Georgi Krustev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Date/Time Pickers
Asked by
OMER
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Share this question
or