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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Checkbox on change event

Thread ID:

Created:

Updated:

Platform:

Replies:

141699 Dec 28,2018 10:05 AM UTC Dec 31,2018 01:40 PM UTC JavaScript - EJ 2 1
loading
Tags: Grid
Arif Nurdiansyah
Asked On December 28, 2018 10:05 AM UTC

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

Thavasianand Sankaranarayanan [Syncfusion]
Replied On 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. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;