• Venky Kambham
  • NEWBIE
  • 5 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 6
    Replies
Dear Team ,

Greetings !!!

I am trying to integrate picklist in inline functionality of lightning datatable . Type column is picklist in below code . My controller code are as follows :

({
    doInit : function(component, event, helper) {
        component.set('v.mycolumns', [
            {label: 'Account Name', fieldName: 'Name', type: 'text', editable: true, initialWidth: 750},
            {label: 'Phone', fieldName: 'Phone', type: 'phone', editable: true},
            {label: 'Rating', fieldName: 'Rating', type: 'text', editable: true},
            {label: 'Number Of Employees', fieldName: 'NumberOfEmployees', type: 'number', editable: true},
             {label: 'Type', fieldName: 'Type', type: 'List', editable: true}
        ]);
        
        var action = component.get("c.details");
        action.setCallback(this, function(response) {
            var state = response.getState();
            
            if (state === "SUCCESS") {
                var res = response.getReturnValue();
                component.set("v.mydata", res);
            }
            else if (state === "ERROR") {
                var errors = response.getError();
                if (errors) {
                    if (errors[0] && errors[0].message) {
                        console.log("Error message: " + 
                                 errors[0].message);
                    }
                } 
                else {
                    console.log(response.getReturnValue());
                }
            }
        });
        $A.enqueueAction(action);
    },
    
    saveTable : function(component, event, helper){     
        //var data = component.get("v.mydata");
        var draftValues = event.getParam('draftValues');
        var action = component.get("c.updateDetails");
        action.setParams({lstForm  : draftValues});
        action.setCallback(this, function(response) {
            var state = response.getState();
            
            if (state === "SUCCESS") {
                var res = response.getReturnValue();
                $A.get('e.force:refreshView').fire();
                alert('Updated Successfully...');
            }
            else if (state === "ERROR") {
                var errors = response.getError();
                if (errors) {
                    if (errors[0] && errors[0].message) {
                        console.log("Error message: " + 
                                    errors[0].message);
                    }
                } 
                else {
                    console.log(response.getReturnValue());
                }
            }
        });
        $A.enqueueAction(action);
    }
})

Kindly suggest some solution in order i am able to perform this functionality .

Thanks & Regards
Sachin Bhalerao
I have a Date field in a Lightning Component that is inside a table.  When you click on the field the table is all messed up with formatting.  I've found that this is due to the field being on a table and inheriting the styling from the table.  It's a stand alone component that works fine when it's not on a table from another component but I need it there.  Does anyone know how to clear the formating from the original table to get the date picker to look correct?

User-added image

This is part of the component that has the date field on it.  This component is called from another component that has a table.
<div class="slds-p-horizontal--medium slds-grid slds-wrap">
   <lightning:input label="Subject" value="{!v.newTask.Subject}" class="slds-size--6-of-12 slds-p-horizontal--medium "/>

    <div class="slds-p-horizontal--medium slds-size--6-of-12">
         <lightning:input label="Due Date" type="date" value="{!v.newTask.ActivityDate}"  />
    </div>
</div>

Any suggestions or thoughts would be greatly appreciated.

Thanks!
Custom\ Standard Lightning component for Lookup fields?