Hello there, so i have 2 checkbox, and i want to make validation of it, when the first checkbox is checked the second one will be unchecked, i don't know how to do that, please help me thx you!
//Code Start Here
ej.base.enableRipple(true);
var officeid = @ViewData["officeid"];
var data = new ej.data.DataManager({
url: '/api/ITHelpdesk?officeid='+officeid,
updateUrl: '/api/ITHelpdesk',
adaptor: new ej.data.WebApiAdaptor()
});
console.log(data);
var grid = new ej.grids.Grid({
dataSource: data,
editSettings: {
allowEditing: true,
allowAdding: false,
allowDeleting: false,
mode: 'Dialog',
showConfirmDialog: true,
showDeleteConfirmDialog: true
},
allowPaging: true,
toolbarTemplate: '#toolbar-template',
height: 500,
queryCellInfo: queryCellInfo,
columns: [
{ type: 'checkbox', field: 'CheckBox', width: 100 },
{ field: 'id', isPrimaryKey: true, visible: false, headerText: 'id', textAlign: 'Right', width: 10, type: 'number' },
{ field: 'officePerusahaanId', visible: false, headerText: 'officePerusahaanId', textAlign: 'Right', width: 10, type: 'number' },
{ field: 'pegawaiId', visible: false, headerText: 'pegawaiId', textAlign: 'Right', width: 10, type: 'number' },
{ field: 'tanggalPengajuan', width: 200, headerText: 'Tanggal Pengajuan', type: 'string', editType: 'datepickeredit', format: { skeleton: 'yMMMEd', type: 'date' }, validationRules: { required: true } },
{ field: 'nik', width: 240, headerText: 'NIK', type: 'string', validationRules: { required: true } },
{ field: 'deskripsi', width: 240, headerText: 'Deskripsi', type: 'string', validationRules: { required: true } },
{ field: 'kategori', width: 140, headerText: 'Kategori', type: 'string', validationRules: { required: true } },
{ field: 'isBiasa', width: 140, headerText: 'Biasa', displayAsCheckBox: true, type: 'boolean', editType: "booleanedit" },
{ field: 'isMendesak', width: 140, headerText: 'Mendesak', displayAsCheckBox: true, type: 'boolean', editType: "booleanedit" },
{
field: 'itHelpdeskStatus', width: 140, headerText: 'ITHelpdeskStatus', type: 'string', validationRules: { required: true },
edit: {
create: function (args) {
return '<div id="status-box" class="e-float-input e-control-wrapper"><label class="e-float-text e-label-top">Status</label><input id="status" /></div>';
},
write: function (args) {
generate(args.rowData[args.column.field]);
},
}
},
{ field: 'recheckOK', width: 140, headerText: 'ReCheck OK', displayAsCheckBox: true, type: 'boolean', editType: "booleanedit" },
],
pageSettings: { pageCount: 2, pageSizes: true },
});
grid.appendTo('#Grid');
//End Here