如何在 AngularJS 中获取 Kendo 日历对象
How can I get Kendo calendar object in AngularJS
我在这里尝试向 Kendo 日历添加滑动功能。我无法检索 Kendo 日历对象。如何在控制器中检索 Kendo 日历对象?
查看页面:
<div class="demo-section k-content" >
<div>
<kendo-calendar ng-model="datestring" style="width: 100%;" ng-click="valuefunction(datestring,dateObject)" k-enable-swipe="true" k-on- swipe="myTouch.swipe(kendoEvent)" k-ng-model="dateObject"></kendo-calendar>
</div>
</div>
控制器:
$scope.myTouch = {
swipe: function(e)
{
if(e.direction=="left")
{
(here i need to access kendo calendarobject).navigateToFuture();
}
else if(e.direction=="right")
{
(here i need to access kendo calendarobject).navigateToPast();
}
}
}
查看页面:
<div class="demo-section k-content" >
<div>
<kendo-calendar kendo-touch ng-model="datestring" style="width: 100%;" k-rebind="datestring" ng-click="valuefunction(datestring)" k-enable-swipe="true" k-on-swipe="myTouch(kendoEvent,datestring)" ></kendo-calendar>
</div>
</div>
控制器页面
$scope.myTouch = 函数(e,日期字符串){
if (e.direction == "left") {
datestring.setDate(datestring.getDate() + 30);
$scope.datestring = datestring;
// $scope.month=datestring;
console.log(datestring);
console.log('swipeleft');
}
// $scope.datestring.navigateToFuture();
else if (e.direction == "right") {
datestring.setDate(datestring.getDate() - 30);
$scope.datestring = datestring;
// $scope.month=datestring;
console.log(datestring);
console.log('swiperight');
}
};
我在这里尝试向 Kendo 日历添加滑动功能。我无法检索 Kendo 日历对象。如何在控制器中检索 Kendo 日历对象?
查看页面:
<div class="demo-section k-content" >
<div>
<kendo-calendar ng-model="datestring" style="width: 100%;" ng-click="valuefunction(datestring,dateObject)" k-enable-swipe="true" k-on- swipe="myTouch.swipe(kendoEvent)" k-ng-model="dateObject"></kendo-calendar>
</div>
</div>
控制器:
$scope.myTouch = {
swipe: function(e)
{
if(e.direction=="left")
{
(here i need to access kendo calendarobject).navigateToFuture();
}
else if(e.direction=="right")
{
(here i need to access kendo calendarobject).navigateToPast();
}
}
}
查看页面:
<div class="demo-section k-content" >
<div>
<kendo-calendar kendo-touch ng-model="datestring" style="width: 100%;" k-rebind="datestring" ng-click="valuefunction(datestring)" k-enable-swipe="true" k-on-swipe="myTouch(kendoEvent,datestring)" ></kendo-calendar>
</div>
</div>
控制器页面
$scope.myTouch = 函数(e,日期字符串){
if (e.direction == "left") {
datestring.setDate(datestring.getDate() + 30);
$scope.datestring = datestring;
// $scope.month=datestring;
console.log(datestring);
console.log('swipeleft');
}
// $scope.datestring.navigateToFuture();
else if (e.direction == "right") {
datestring.setDate(datestring.getDate() - 30);
$scope.datestring = datestring;
// $scope.month=datestring;
console.log(datestring);
console.log('swiperight');
}
};