You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In this example we will customize the same component and achieve to the editing row, saving row and removing rows functionality of dynamically on Custom sObject by help of wrapper apex class and JavaScript Controller in lightning component.
action.setCallback(this, function(response){
var state = response.getState();
if(state=='SUCCESS'){
var result = response.getReturnValue();
component.set('v.wrapListItems',result);
}
});
$A.enqueueAction(action);
}
In this post we are going to learn about that how to edit row, saving row or removing row dynamically in Salesforce lightning component.
In this example we will customize the same component and achieve to the editing row, saving row and removing rows functionality of dynamically on Custom sObject by help of wrapper apex class and JavaScript Controller in lightning component.
→ Get source code live demo link:-
Step 1:- Create Lightning Component : wrapperClassCustomObjCmp.cmp
` <aura:component controller="wrapperCustomObjCtrCmp" implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction,lightning:isUrlAddressable" access="global" >
</aura:component>`
Step 2:- Create Lightning Component : wrapperClassCustomObjCmpConroller.js
` ({
doInit : function(component, event, helper) {
Step 3:- Create Lightning Component : wrapperClassCustomObjCmpHelper.js
` ({
refreshView : function(component, event, helper) {
var action = component.get("c.appCustomWrapListMthd");
})`
Step 4:- Create Lightning Component : wrapperClassCustomObjCmp.css
` .THIS {
}
.THIS .slds-table thead tr th{background-color:#eee;}
.THIS .slds-table thead tr th, .THIS .slds-table tbody tr td {border:1px #dddbda solid; border-collapse: collapse; white-space: normal;}
.THIS .editSpan:before{content:''; width:17px; height:17px; display:inline-block; background:url(https://www.w3web.net/wp-content/uploads/2022/01/edit_120.png) no-repeat left top; background-size:cover; cursor: pointer;}
.THIS .saveSpan:before{content:''; width:17px; height:11px; display:inline-block; background:url(https://www.w3web.net/wp-content/uploads/2022/01/SaveToCloud.png) no-repeat left top; background-size:cover; cursor: pointer;}
.THIS .delSpan:before{content:''; width:17px; height:17px; display:inline-block; background:url(https://www.w3web.net/wp-content/uploads/2022/01/delete.png) no-repeat left top; background-size:cover; cursor: pointer;}
.THIS .cancelSpan:before{content:''; width:17px; height:17px; display:inline-block; background:url(https://www.w3web.net/wp-content/uploads/2022/01/closeIcon.png) no-repeat left top; background-size:cover; cursor: pointer;}
.THIS .createRecord:before{content:''; width:15px; height:17px; display:inline-block; background:url(https://www.w3web.net/wp-content/uploads/2022/01/createRecordIcon.png) no-repeat left top; background-size:cover; cursor: pointer;}`
Step 5:- Create Lightning Application : wrapperCustomObjCtrCmp.apxc
` public class wrapperCustomObjCtrCmp {
}`
→ Get source code live demo link:-
The text was updated successfully, but these errors were encountered: