Titanium Community Questions & Answer Archive

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

Delete all rows in a tableview with a single click

Hi there,

has anyone a good way to "clear" the table?
I want to build a button which deletes all my rows, so that i can add some new data in my tableview.

— asked August 3rd 2010 by Michael Gajda
  • button
  • clear
  • delete
  • iphone
  • mobile
  • table
  • tablerow
  • tableview

2 Answers

  • Accepted Answer

    Call the setData() method on the Titanium Tableview object (named tblExample below) like such:


    This will assign an empty array to the row data.

    — answered October 22nd 2011 by Elden Armbrust
    1 Comment
    • That or either you can tblExample.data = [];

      — commented September 11th 2012 by Eugenio Melendez
  • You can implement it simply by assigning " " to tableView Object

    — answered July 7th 2011 by Jiale He
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.