Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

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!

— asked July 22nd 2010 by MeYou Health
  • persistence
  • properties
  • refresh
  • tab
  • tableview
0 Comments

1 Answer

  • Accepted Answer

    the_button.addEventListener('click', function(){
       the_table.setData( the_data_array )
    )
    
    — answered July 22nd 2010 by Dan Tamas
    permalink
    2 Comments
    • Yes that would work, but the table is on a different window. How can I call the setData method from a different window?

      — commented July 22nd 2010 by MeYou Health
    • Nevermind, I found that I could use the 'focus' event on the current window. Thank you!

      — commented July 22nd 2010 by MeYou Health
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.