I have a custom stand-alone app that has a custom component which makes use of a lightning tabset. On one of the tabs, there is a lightning datatable. I would like to create a refresh button that when pressed will rerender or refresh the table to display the latest data. I would like for the rerendering to only be at the table level or at most, the tab level without affecting the rest of the app. How do I go about doing this? Any advice or help is highly appreciated.
1 Answer
This happens pretty much automatically simply by binding the correct attributes to the component. For example, given:
<lightning:tab ...>
<lightning:datatable data="{!v.tabXdata}" ... />
</lightning:tab>
When you specify a new value for v.tabXdata, only the table will be rerendered. Other components will not undergo a render cycle. You may want/need to create more attributes to make sure this happens appropriately.