How to refresh a table upon tab selection
In my current application, I have a table view on the second tab's window and a button in first tab's window that adds a new entry to the array of data the table view reads from.
When the button is clicked and a new entry to the array is successfully added, the table does not reflect the addition because it has already loaded the data (if viewed previously).
How can I refresh the table view when the second tab is selected everytime?
Thanks in advance!
1 Answer
-
Accepted Answer
the_button.addEventListener('click', function(){ the_table.setData( the_data_array ) )