如何为ui-grid复选框添加确认框?

时间:2016-02-18 09:21:09

标签: angularjs angular-ui-grid

How to add confirm box for ui-grid check box ?


The defaultYn value, tried to add a confirm message before making a server call.

vm.gridOptions1 = {                 enableColumnResizing:true,                 enableAutoResizing:false,                 enableHorizo​​ntalScrollbar:1,                 enableRowSelection:true,                 enableRowHeaderSelection:false,

             appScopeProvider: vm.myAppScopeProvider,
            //  rowTemplate: "<div ng-dblclick=\"grid.appScope.openOtherPavacce(row)\" ng-repeat=\"(colRenderIndex, col) in colContainer.renderedColumns track by col.colDef.name\" class=\"ui-grid-cell\" ng-class=\"{ 'ui-grid-row-header-cell': col.isRowHeader }\" ui-grid-cell></div>",
            columnDefs: [

                         {field: 'jobVaccinationPK.screeningTypeMast.screeningType', displayName: 'Screening type',type: 'text',width: '27%', enableCellEdit: false},
                         {field: 'jobVaccinationPK.jobCategoryTypeMast.jobCategoryName', displayName: 'Job Category',width: '27%', enableCellEdit: false},
                         {field: 'jobVaccinationPK.vaccinationMast.vaccinationName', displayName: 'Vaccination', width: '27%', enableCellEdit: false},
                         {field: 'defaultYn', displayName: 'DefaultYn',width: '10%' , cellTemplate: '<input type="checkbox" ng-model="row.entity.defaultYn" ng-really-message="Are you sure ?" ng-really-click="grid.appScope.updateRow(row)"  ng-true-value="\'Y\'" ng-false-value="\'N\'">'}, 
                         {
                             //field:'', 
                             name: 'Action',
                             cellTemplate: '<button class="btn btn-primary-joli" ng-click="grid.appScope.deleteRow(row)">Delete</button>',width: '9%'
                         }

              ],


             onRegisterApi: function(gridApi) {
                 vm.gridApi = gridApi;


                 var cellTemplate='<div style= \"height:100px \" class=\"ui-grid-row-header-cell ui-grid-expandable-buttons-cell\"><div class=\"ui-grid-cell-contents\"><i ng-class=\"{ \'glyphicon glyphicon-calendar \' : row.entity.visitMasts[0].orderses.length !== 0 }\" ng-click=\"grid.appScope.showPopup(row)\" style=\"color: rgb(212, 106, 64)\";></i></div></div>'; //

                 vm.gridApi.core.addRowHeaderColumn( { name: 'rowHeaderCol', displayName: '', width: 30, cellTemplate: cellTemplate , headerTooltip: 'Click icon to see details'} );

               vm.gridOptions1.multiSelect = false;
               vm.gridOptions1.modifierKeysToMultiSelect = false;
               vm.gridOptions1.noUnselect = true;
            }       
          };

0 个答案:

没有答案