0

I have lightning datatable with below definition

Component table definition:

 <lightning:datatable aura:id="PYearTable"
            columns="{!v.columns}"
            data="{!v.data}"
            keyField="Id"
            onsave="{!c.saveFunction}"                
            draftValues="{!v.draftValues }"
            hideCheckboxColumn="true"
            oncellchange="{!c.handleCellChange}"
            showRowNumberColumn="true" onrowaction="{!c.handleRowAction }" />   

Columns:

var cols = [
    {
        type: "button",
        typeAttributes: {
            label: 'Delete',
            name: 'deleteRecord',
            title: 'Delete',
            disabled: false,
            value: 'Delete',
            iconName: 'utility:delete',
            iconPosition: 'left'
        }
    },
    {
        label: 'Production Year',
        fieldName: 'Name',
        type: 'text'
    },
    {
        label: 'Fully Ramped Production',
        fieldName: 'isFRP__c',
        type: 'boolean',
        editable:true
    },                              
    {
         label: 'Quantity',
         fieldName: 'Quantity__c',
         type: 'number',
         editable:true
    }                                
];

Now, for boolean type column i want to have only one row's checkbox selected type.i.e when i select checkbox of row1 and the checkbox of row2 then checkbox of row1 should become false and similar thing continues for further selection latest selected should be true and rest false.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.