【问题标题】:How can I get Kendo calendar object in AngularJS如何在 AngularJS 中获取剑道日历对象
【发布时间】:2016-02-18 10:06:25
【问题描述】:

我正在尝试将滑动功能添加到剑道日历。我无法检索剑道日历对象。如何在控制器中检索剑道日历对象?

查看页面

<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(); 
        } 
    }
}

【问题讨论】:

标签: javascript jquery angularjs calendar kendo-mobile


【解决方案1】:

查看页面:

<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 = function(e, datestring) {

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');
}

};

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2023-04-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-10-27
    • 2014-07-27
    • 1970-01-01
    相关资源
    最近更新 更多