UI回调函数中的网格复选框选择变化

UI grid check box selection change in a call back function

要check/uncheck复选框的值,当甜蜜提醒取消事件被选中时。

在回调函数中,无法重新设置复选框的值。

$scope.updateRow = function(row) {
  SweetAlertService.confirm('Are you sure?','', function(isConfirmed) {
    if (isConfirmed) {

    }else{
          if(row.entity.employed == "Y"){
         row.entity.employed = "N";
       }else if(row.entity.employed == "N"){
         row.entity.employed = "Y";
    }
     });

代码在这里。 http://plnkr.co/edit/Sd7Uk5yTkhPFnzrsDknp?p=preview

运行 所需的更改如下:

  1. SweetAlert.js 中将计时器设置为更大的值。当前为1500,设置为定时器:150000.
  2. 在网格定义中包含 onRegisterApi,在单击取消重置复选框的值后,只需使用 $scope.gridApi.core.refresh()
  3. 刷新网格

更新的 Plunker 代码:Here

希望对您有所帮助!