This is a UI grid entry for creating a check box dynamically,
{
field: 'defaultYn',
displayName: 'DefaultYn',
width: '10%',
enableFiltering: false,
cellTemplate: '<input type="checkbox" ng-model="row.entity.defaultYn" ng-click="grid.appScope.updateRow(row);" ng-true-value="\'Y\'" ng-false-value="\'N\'">'
}
Here in updateRow, need to update the check box value programatically,
$scope.updateRow = function(row) {
SweetAlertService.confirm('Are you sure?','', function(isConfirmed) {
if (isConfirmed) {
}else{
/* deselect the check box, code not working
row.entity.defaultYn= "Y";*/
}
});
Sweet Alert code section
confirm: function(title, message, callback) {
swal({
title: title,
text: message,
type: "warning",
showCancelButton: true,
confirmButtonColor: '#33414e',
confirmButtonTexColor: '#FFF;',
closeOnConfirm: true,
closeOnCancel: true,
timer: 1500
},
function(isConfirm) {
callback(isConfirm);
});
}
Here not able to set the UI grid selected row values check box programmatically. How can I enable or disable a checkbox in UI grid through angular js code.
Here is the issue http://plnkr.co/edit/Sd7Uk5yTkhPFnzrsDknp?p=preview.