Titanium Community Questions & Answer Archive

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

Appending data to an Array set with Titanium.App.Properties.setList('appwindows', appwindows);

I need some help; I am trying to append data to an empty array that has been set with Ti.App.Properties.setList.

in app.js I have the following lines:

var appwindows = [];
Titanium.App.Properties.setList('appwindows', appwindows);
Titanium.App.addEventListener( "UPDATE_WINDOW_ARRAY",  function(win) {
  //What do I need here to append string values to the array appwindows?

});

I can not seem to append data to the array, appwindows

Thank you in advance for assistance.

— asked November 30th 2010 by Michael Updegraff
  • addeventlistener
  • appending
  • arrays
  • setlist
0 Comments

1 Answer

  • Accepted Answer

    Michael

    I believe have to getList(), assign it to a local array, add the new elements, and then assign the array back to the property using setList().

    — answered November 30th 2010 by Paul Dowsett
    permalink
    0 Comments
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.