We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Checkbox on change event

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

1 Reply

TS Thavasianand Sankaranarayanan Syncfusion Team December 31, 2018 01:40 PM UTC

Hi Arif, 

Greetings from Syncfusion. 

Before proceeding to your query please provide the following details. 

  1. Are you want to change the Boolean edit column value when we check/uncheck checkbox column (first column) in Grid ?
  2. Are you want to change the other column checkbox value when you in the edit state or not?  
  3. Are you want to change Boolean column value when we select the row through the checkbox column in Grid ?
  4. Whether you want to change the other cell values in edit mode?
  5. Share your exact requirement on using checkbox with Grid.

Regards, 
Thavasianand S. 


Loader.
Live Chat Icon For mobile
Up arrow icon