小编Sau*_*abh的帖子

ng-click不能从ui-grid复选框cellTemplate工作

我搜索了很多这个问题,但没有得到任何解决方案,实际上正在努力满足我的需求.问题:我想在单击具有columnDef as的复选框时选择行实体 [{name: 'field01', displayName: '', field: 'field01', cellTemplate: "<input type='checkbox' ng-model='row.entity.field01' ng-click='grid.appScope.myhello()' />"}.

我正在基于另一个JSON [更新工作代码]动态构建此columnDef

  $scope.columnDef = function(){
    var column = [{name: 'field01', displayName: '', field: 'field01', cellTemplate: "<input type='checkbox' ng-model='row.entity.field01' ng-click='grid.appScope.myhello(\"row.entity.field01\")' />"}], coltype = [];
    angular.forEach($scope.columns, function(value, index){
      coltype = [];
      switch(value.type){
        case "Number":  coltype.push({type: "number"});
                        break;
        case "String":  break;
        case "Boolean": coltype.push({editableCellTemplate: "ui-grid/dropdownEditor", cellFilter: "mapBool", editDropdownValueLabel: "bool", editDropdownOptionsArray: [{ id: 1, bool: 'Yes' },{ id: 2, bool: 'No' }] });
                        break;
        case "Date":    coltype.push({type: 'date', cellFilter: …
Run Code Online (Sandbox Code Playgroud)

javascript angularjs angular-ui-grid

2
推荐指数
1
解决办法
6172
查看次数

标签 统计

angular-ui-grid ×1

angularjs ×1

javascript ×1