You need to sign in to do that
Don't have an account?
Sangeet kasera
Inline Editing in Salesforce Lightning using HTML Table?
I am using inline editing in my table tag, to update the data of any cell.
I iterated table data from apex class, also i have implemented ondbclick() for edit the cell but when I am double clicking on the cell then it edit whole column.
I want, When i am double clicking of any cell on column Email Digest it edit's only that cell.
Below Snapshot-
Below is my table from itertion-
<aura:attribute name="showLink" type="Boolean" default="true" />
<aura:iteration items='{!v.subscriptions}' var="sub" >
<tr class="backround_colr bg-altrnate-color">
<td>{!sub.subs.ObjectSubscription__c}</td>
<td>{!sub.objTitle}</td>
<td>{!sub.subs.Record_Id__c}</td>
<td ondblclick = "{!c.inlineEdit}" style="{! v.showLink == true ? '' : 'display:None'}">{!sub.subs.Email_Digest__c}</td>
<div style="{! v.showLink == false ? '' : 'display:None'}">
<lightning:input name="titleField" required= "true" aura:id="titleFieldVal" label="Title" value="{!sub.subs.Email_Digest__c}"/><br/>
<div class="slds-align_absolute-center" >
<lightning:button variant="brand" value="{!v.itrr.id}" label="Save" title="Save" onclick="{! c.saveRecord }" />
<lightning:button variant="brand" value="{!v.itrr.Title}" label="Cancel" title="Cancel" onclick="{! c.cancelRecord }" />
</div>
</div>
<td>{!sub.subs.SubscribedBy__c}</td>
<td><lightning:button variant="{!sub.subs.Activated__c==true ? 'destructive' : 'success'}" class="buttonStyle" label="{!sub.subs.Activated__c==true ? 'UnSubscribe' : 'Subscribe'}" value="{!sub.subs.Id}" onclick="{!c.handleSubsOrUnSubs}"/></td>
</tr>
</aura:iteration>
Controller for ondbclick-
inlineEdit : function(component, event, helper) {
component.set("v.showLink",false);
},
I iterated table data from apex class, also i have implemented ondbclick() for edit the cell but when I am double clicking on the cell then it edit whole column.
I want, When i am double clicking of any cell on column Email Digest it edit's only that cell.
Below Snapshot-
Below is my table from itertion-
<aura:attribute name="showLink" type="Boolean" default="true" />
<aura:iteration items='{!v.subscriptions}' var="sub" >
<tr class="backround_colr bg-altrnate-color">
<td>{!sub.subs.ObjectSubscription__c}</td>
<td>{!sub.objTitle}</td>
<td>{!sub.subs.Record_Id__c}</td>
<td ondblclick = "{!c.inlineEdit}" style="{! v.showLink == true ? '' : 'display:None'}">{!sub.subs.Email_Digest__c}</td>
<div style="{! v.showLink == false ? '' : 'display:None'}">
<lightning:input name="titleField" required= "true" aura:id="titleFieldVal" label="Title" value="{!sub.subs.Email_Digest__c}"/><br/>
<div class="slds-align_absolute-center" >
<lightning:button variant="brand" value="{!v.itrr.id}" label="Save" title="Save" onclick="{! c.saveRecord }" />
<lightning:button variant="brand" value="{!v.itrr.Title}" label="Cancel" title="Cancel" onclick="{! c.cancelRecord }" />
</div>
</div>
<td>{!sub.subs.SubscribedBy__c}</td>
<td><lightning:button variant="{!sub.subs.Activated__c==true ? 'destructive' : 'success'}" class="buttonStyle" label="{!sub.subs.Activated__c==true ? 'UnSubscribe' : 'Subscribe'}" value="{!sub.subs.Id}" onclick="{!c.handleSubsOrUnSubs}"/></td>
</tr>
</aura:iteration>
Controller for ondbclick-
inlineEdit : function(component, event, helper) {
component.set("v.showLink",false);
},
Can you try using the visualforce tags as mentioned in the below documentation link and check if the issue persists?
>>https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_quick_start_inline_editing.htm
I hope this helps, in case if this comes handy can you please choose this as best answer so that it can be used by others in the future.
Regards,
Anutej.
I used visualforce tag in my lightning page, but it is not acceptable by lightning says invalid attribute.
Will you please refer any other link or any simple example for inline editing in lightning or edit my code to find the solution of it
Regards,
Sangeet