-1

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
  • 3
    What have you tried so far? Where are you stuck? (For example, have you looked at using events? Wiring the button to a handler function to perform a refresh?)
    – David Reed
    Commented Sep 26, 2019 at 3:07

1 Answer 1

2

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.

Not the answer you're looking for? Browse other questions tagged .