【问题标题】:Kendo template button ng-click not working剑道模板按钮 ng-click 不起作用
【发布时间】:2016-03-07 06:55:03
【问题描述】:

模板中的剑道-点击按钮不起作用。帮助我们!

<div ng-controller="RiskProcessController">
   <script id="link-template" type="text/kendo-templ">  
        <button id="nextButton" class="btn btn-primary newButton" ng-click="Test()"> Click</button>
     </script>
 </div>

角度控制器

manageApp.controller("RiskProcessController", ['$scope', '$http', '$uibModal',  function ($scope, $http, $uibModal, riskServices) {
   $("#Risks").kendoGrid({
        dataSource: dataSource,
        detailTemplate: kendo.template($("#link-template").html()),
        detailInit: detailInit,
        columns: []
     }
    $scope.Test = function(){
     console.log("test");
    }
}]);

【问题讨论】:

    标签: angularjs kendo-ui kendo-grid


    【解决方案1】:

    您正在使用 jQuery 语法初始化 KendoGrid,这是不推荐的,并且会导致您出现问题。

    为什么不使用 Kendo 提供的 Angular/Kendo 指令呢?

    请在此处阅读有关如何操作的文档:http://demos.telerik.com/kendo-ui/grid/angular

    如果你这样做,那么你可以做类似的事情;

    <div kendo-grid k-options="gridOptions" ng-controller="RiskProcessController">
        // grid code
    </div>
    
    manageApp.controller("RiskProcessController", ['$scope', '$http', '$uibModal',  function ($scope, $http, $uibModal, riskServices) {
    
        $scope.mainGridOptions = {
            dataSource: {},
            sortable: true,
            pageable: true,
            dataBound: function() {
                columns: []
            };
        }
    }]);
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-10-10
      • 2016-06-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-06-19
      • 2013-05-05
      • 1970-01-01
      相关资源
      最近更新 更多