function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
suri03081988suri03081988 

Work around for dropdown in <lightening:datatable

Hi All,

My requirement is to select a status field from the dropdown option in <Lightening:datatable 

sample code is

Component Sample code:
<lightning:datatable
                                     columns="{!v.fu_columns }"
                                     class= "table-test"
                                     data="{!v.data }"
                                     keyField="Id"
                                     hideCheckboxColumn="true"
                                     draftValues="{! v.draftValues }"
                                     onsave="{! c.handleSaveEdition }"
                                     onrowaction="{!c.selectDropDown}"
                                     />
JS controller:
init : function(component, event, helper){
        component.set('v.fu_columns', [
        {label:'User Description', fieldName:'Description__c',      type:'Text',editable: true},
        {type: 'button', typeAttributes: {
                label: 'Select',
                name: 'Select',
                title: 'Select',
                disabled: false,               
            }}        
    ]);
}

selectDropDown : function(component, event, helper){        
        var recId = event.getParam('row').Id;
        var actionName = event.getParam('action').name;
        if ( actionName == 'Select' ) {
            alert('==Select');
            >> Please guide some sample code to open a popup and select one value for status and that will updated in backend
        }     
    },


THanks in advance


 
PriyaPriya (Salesforce Developers) 
Hi,

This blog will help you to set up the modal/popup :-
 https://www.sfdcpoint.com/salesforce/modal-popup-lightning-component-salesforce/
 

Kindly mark it as the best answer if it works for you.

 

Thanks & Regards,

Priya Ranjan