mercredi 20 janvier 2021

Set to allow user to only tick one checkbox in DataGrid js

I am quite new in JavaScript and I am currently doing a DataGrid using data in SQL database. I have two columns which contain boolean values and I want the user to only input in either one of them. This is my snippet of my code so far:

$("#LEGAL_ENTITY_TYPES").dxDataGrid({
                dataSource: LegalEntityTypesCS,
                allowColumnReordering: true,
                allowColumnResizing: true,
                showBorders: true,
                rowAlternationEnabled: true,
                //showRowLines: true,
                hoverStateEnabled: false,
                wordWrapEnabled: true,
                columnAutoWidth: true,
                //focusedRowEnabled: true,
                searchPanel: {
                    highlightCaseSensitive: false,
                    highlightSearchText: true,
                    placeholder: "Search...",
                    searchVisibleColumnsOnly: false,
                    text: "",
                    visible: true,
                    width: 350
                },
                 headerFilter: {
                   visible: true
                },
                paging: {
                    pageSize: 15
                }, 
                columns: [{
                        dataField: "ORGANIZATION_INDICATOR",
                        caption: "Organization",
                        hidingPriority: 2,
                        dataType: "boolean",
                    }, {
                        dataField: "INDIVIDUAL_INDICATOR",
                        caption: "Individual",
                        hidingPriority: 1,
                        dataType: "boolean"}]

I want the user to either tick the box for organization_indicator or individual_indicator. Can someone help in achieving this?

Thanks




Aucun commentaire:

Enregistrer un commentaire