0

As per the title, I have a datatable component nested inside my recordEditForm to display and edit some data (and never submitting, thus the suppressBottomBar="true"). The weird thing is that whenever a user does an inline edit on the datatable, the onsubmit() for the recordEditForm is immediately called. Is there a solution to either preventing the onsubmit() from calling altogether or having a way to find the origin of the onsubmit() call (coming from a datatable inline edit) and then canceling the submission? Thanks!

<lightning:recordEditForm aura:id="mainForm"
         objectApiName="Account"
         onsubmit="{!c.handleOnSubmit}"
         onsuccess="{!c.handleOnSuccess}"
         onerror="{!c.handleOnError}">
... 
<lightning:datatable 
  data="{! v.data }"
  columns="{! v.columns }"
  keyField="Id"
  hideCheckboxColumn="true"
  suppressBottomBar="true" 
  onrowaction="{!c.rowAction}"
  oncellchange="{!c.rowChange}"/> 
...
<!-- Submit button also here-->
</lightning:recordEditForm>
  • why do you even want to use datatable inside record? – salesforce-sas Sep 5 at 2:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.