2

Its it possible to rig up editable lightning:datatable to do saves via lightning data service? In the few samples (very few) saves requests are sent to an APEX controller that you need to write. Wouldn't it make sense to be able to manage updates via LDS?

  • Did you know that lightning:datatable now supports inline editing? Unless that's not what you meant. – Lightning Evangelist Aug 2 '18 at 14:15
  • Yes, that is what I am asking about. Can the saves from inline edit be hooked up to LDS in anyway or are we forced to post updates to an APEX controller? – Homerlex Aug 2 '18 at 14:26
3

You will necessarily want to use Apex Code. Even though one could use the Lightning Data Service to update those records, it is intended to be used only on record at a time, so, especially in mass updates, you would have very poor performance. For example, editing 50 records with an Apex Code controller would result in a fraction of a second for saving, but would result in, at minimum, 1-2 seconds using LDS. According to a previous test I did, I found that LDS can be up to about 50,000% (500 times) slower than Apex Code for bulk load/save cases over anything more than about 5 records.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.