I have a hierarchy of nested data wrapped in custom wrappers, and these are then iterated over to render nested lightning components. All good so far.

If I add records at any level, pass changed array to the top level component and set the top level attribute the UI rerenders as expected, confirming the bindings are working.

However, if I delete an element from the same nested data and fire the same process ie update the ui from the top most component, then no changes are pssed to the UI, despite the change definitely being set in the latest top level data attribute.

So - how does one ensure changes to data in a lightning component are actually bound to and reflected in the UI ? Using set doesnt seem to work consistently.

Any ideas most appreciated.

  • Can share code to reproduce the issue, so that we can help you out. – Praveen Oct 5 '16 at 9:18
  • Hi Praveen - there is a significant code base of at least 4 components and at least 5 events. I dont want to put you through that! :) I do wonder though what determines if data is bound or not, if it is stored inside a component attribute. – CloudHugger Oct 5 '16 at 10:41
  • I understand but without code its difficult for us to follow/debug the issue. It might a bug in the framework or something you might be missing.if you post a sample code to reproduce the issue, it becomes easy to track the issue down. – Praveen Oct 5 '16 at 10:46
  • All good. Too hard to cull the code base and not lose something probably important. Thanks for tour consideration anyway. – CloudHugger Oct 5 '16 at 11:05

If anyone sees this behaviour in their apps, I addressed it by making the changes to data less granular. That is, instead of a single record change within an array, I rebuilt an array of child records from scratch and then updated the attribute. This 'higher level' change to data seemed to register on the bindings radar and initiated a UI update.

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.