Search code examples
appceleratorappcelerator-titanium

How to add a row at a particular index in titanium


I have a table in titanium, and I have added 3 rows. In one scenario I have removed a 2nd row from the table table.deleteRow(index) and after some process I need to add a row at that index.

Can any one please let me know how to add a row at a particular index.


Solution

  • You can use

    insertRowAfter : http://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.TableView-method-insertRowAfter

    or insertRowBefore : http://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.TableView-method-insertRowBefore to do this