-
ui-grid rowSelectAngular JS 2017. 4. 25. 13:00
$scope.studentgrid = { data: 'students', enableFiltering: false, onRegisterApi: function(gridApi){ $scope.gridApi = gridApi; $scope.gridApi.grid.registerRowsProcessor( $scope.singleFilter, 200 ); }, enableRowSelection: true, multiSelect: false, enableColumnResizing: true, enableSelectAll:true, enableCellEdit: false, enableFullRowSelection: true, enableCellEditOnFocus: false, columnDefs: [ { field: 'ID'}, { field: 'name'}, { field: 'age' }, { field: 'email', displayName: 'Email(Sorting Disabled)', enableSorting: false }, { field: 'Change', cellTemplate: '<div><button ng-click="grid.appScope.genalert()">Click Here</button></div>'} ] };
수정
ellTemplate: '<div><button ng-click="grid.appScope.buttonClicked = true;grid.appScope.genalert()">Click Here</button></div>'
gridApi.selection.on.rowSelectionChanged($scope, function (row) { if (!this.grid.appScope.buttonClicked) { alert(row.isSelected); } this.grid.appScope.buttonClicked = false; });
'Angular JS' 카테고리의 다른 글
FormData data and file Upload (0) 2018.11.26 angular js 예제 프로그램 모음 (0) 2017.05.28 ui-grid 함수 사용하기 (0) 2017.04.24 ui-grid 컬럼정의 (0) 2017.04.23 ui-grid option항목 (0) 2017.04.23