我搜索了很多这个问题,但没有得到任何解决方案,实际上正在努力满足我的需求.问题:我想在单击具有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)