Search code examples
androidtitaniumappceleratortitanium-mobile

Clear content of view in Titanium


I have a view that contains tableview that contains data loaded from web i.e various places and in another topview i have a data pick dialog that can set km for radius. So on changing value I want to clear data in tableview and load new data according to radius selected by the user


Solution

  • You should be able to just create an empty array to clear the data, and set it to your new data array. Something like:

    tableview.data = []; // Clears the array
    tableview.data = [newArray]; // Sets the new data