javascript - How to disable or uncheck a checkbox in ng-grid? -
i need disable or uncheck checkbox depending on condition. try solution how disallow selection beforeselectionchange select chekbox selection in ng-grid, row (the data) it's selected.
$scope.gridqueryreporte = { data: 'datapaginadaintegrantes', columndefs: [{ field: 'numerosolicitud', displayname: 'label_id_solicitud', headercelltemplate: loadheadergrid(), celltemplate: loadcellgrid() }, { field: 'tiponumidsolicitud', displayname: 'tipo y no. id solicitud', headercelltemplate: loadheadergrid(), celltemplate: loadcellgrid() }, { field: 'nombresolicitud', displayname: 'nombre solicitud', headercelltemplate: loadheadergrid(), celltemplate: loadcellgrid() }, { field: 'tiponumidintegrante', displayname: 'tipo y no. id integrante', headercelltemplate: loadheadergrid(), celltemplate: loadcellgrid() }, { field: 'nombreintegrante', displayname: 'label_nombre_integrante', headercelltemplate: loadheadergrid(), celltemplate: loadcellgrid() }, { field: 'fechapublicacion', displayname: 'label_fecha_publicacion_solicitud', headercelltemplate: loadheadergrid(), celltemplate: loadcellgrid() }, { field: 'estado', displayname: 'label_estado', headercelltemplate: loadheadergrid(), celltemplate: loadcellgrid() }, { field: 'anotacion', displayname: 'label_con_anotacion', headercelltemplate: loadheadergrid(), celltemplate: loadcellgrid() }, { field: 'idintegrante', displayname: 'label_titulo_detalle_solicitud', headercelltemplate: loadheadergrid(), celltemplate: loadcellgrid({ type: 'img', image: 'verdetallegrid', tovalidate: 'idintegrante', funcion: 'abrirmodaldetalle(row.entity)' }) }], primarykey: "idintegrante", enablerowselection: true, showselectioncheckbox: true, multiselect: true, selectwithcheckboxonly: true, selecteditems: $scope.integranteseleccionado, showcolumnmenu: true, enablepaging: true, showfooter: true, pagingoptions: $scope.pagingoptionsintegrantes, filteroptions: $scope.filteroptions, showfilter: true, afterselectionchange: function (rowitem) { $scope.contadorbanderaboton = $scope.gridqueryreporte.selecteditems.length; $scope.selectedids = []; var objetointegrante = {}; angular.foreach($scope.integranteseleccionado, function (item) { //here want uncheck or disable checkbox if (item.rutareporteriesgos == null || item.rutareporteriesgos == "") { if (rowitem.selected) { $scope.gridqueryreporte.selectrow(rowitem.rowindex, false); } } }); }
};
Comments
Post a Comment