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";
}
});
运行 所需的更改如下:
- 在
SweetAlert.js
中将计时器设置为更大的值。当前为1500,设置为定时器:150000.
- 在网格定义中包含
onRegisterApi
,在单击取消重置复选框的值后,只需使用 $scope.gridApi.core.refresh()
刷新网格
更新的 Plunker 代码:Here
希望对您有所帮助!
要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";
}
});
运行 所需的更改如下:
- 在
SweetAlert.js
中将计时器设置为更大的值。当前为1500,设置为定时器:150000. - 在网格定义中包含
onRegisterApi
,在单击取消重置复选框的值后,只需使用$scope.gridApi.core.refresh()
刷新网格
更新的 Plunker 代码:Here
希望对您有所帮助!