November 2018

Salesforce

How to show different colors for buttons in lighting datatable in Salesforce?

Sample Code: Component: <aura:component implements = "force:appHostable"                     controller = "AccountListController">                  <aura:attribute type = "object[]" name = "acctList"/>         <aura:attribute name = "mycolumns" type = "List"/>                  <aura:handler name = "init" value="{!this}" action="{!c.onInit}"/>                  <lightning:datatable aura:id = "acctTable"                            data = "{! v.acctList }"                               columns = "{! v.mycolumns }"                               keyField = "Id"                              hideCheckboxColumn = "true"                            onrowaction = "{! c.viewRecord }"/>              </aura:component>   Controller: ({                onInit : function( component, event, helper ) {                        component.set( 'v.mycolumns', [                 {label: 'Account Name', fieldName: 'Name', type: 'text', editable:'true'},                 {label: 'Industry', fieldName: 'Industry', type: 'text'},                               {label: 'Type', fieldName: 'Type', type: 'Text'},               {type: "button", typeAttributes: {                   label: 'View',   ....

Salesforce

Inline editing in lightning:datatable in Salesforce Lightning Component

Sample Code:Component:<aura:component implements="force:appHostable"                    controller="AccountListController">                <aura:attribute type="object" name="acctList"/>        <aura:attribute name="mycolumns" type="List"/>                <aura:handler name="init" value="{!this}" action="{!c.onInit}"/>                <lightning:datatable aura:id="acctTable"  ....