HOW TO BIND ng-model to kendo ui datetimepicker [Resolved]

Posted by Kasani007 under AngularJS 1x on 4/19/2016 | Points: 10 | Views : 2623 | Status : [Member] | Replies : 1
HOW can i add add ng-model to

$("#datefrom")
.kendoDatePicker({ format: "dd/MM/yyyy", parseFormats: ["yyyy/MM/dd"] })
.data("kendoDatePicker");
$("#tdatefrom").attr("readonly", "readonly");


so that i can capture the date i selected in to ng-model..




Responses

Posted by: Rajnilari2015 on: 4/20/2016 [Member] [Microsoft_MVP] [MVP] Platinum | Points: 50

Up
0
Down

Resolved
Try this

<!DOCTYPE html>

<html>
<head>
<title></title>
<link rel="stylesheet" href="styles/kendo.common.min.css" />
<link rel="stylesheet" href="styles/kendo.default.min.css" />

<script src="js/jquery.min.js"></script>
<script src="js/angular.min.js"></script>
<script src="js/kendo.all.min.js"></script>
</head>
<body>
<div id="example" ng-app="KendoDemos">
<div class="demo-section k-content" ng-controller="MyCtrl">
<h4>Select date and time:</h4>
<input kendo-date-time-picker
ng-model="str"
k-ng-model="obj"
style="width: 100%;" />
<pre>
str: {{ str }}
obj: {{ obj }}
typeof obj: {{ getType(obj) }}
obj instanceof Date: {{ isDate(obj) }}
</pre>
</div>
</div>

<script>
angular.module("KendoDemos", [ "kendo.directives" ])
.controller("MyCtrl", function($scope){
$scope.getType = function(x) {
return typeof x;
};
$scope.isDate = function(x) {
return x instanceof Date;
};
})
</script>


</body>
</html>


hope this will be helpful.Let us know about your progress

--
Thanks & Regards,
RNA Team

Kasani007, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response