Search code examples
javascriptdatetitaniumappcelerator

Adding data to createTableViewRow() in appcelerator


How can i add custom data to a TableViewRow?

I'm using createTableViewRow() to setup a TableRow which I'm then added labels and images to it, then finally putting all these TableRows in a TableView. This works fine, but the rows need to have a "date" attribute attached to them, as I'm sorted these rows by dates before they are shown in the TableView.

How would i add a "date" to these TableRows? All these are unixtimestamps.


Solution

  • var row = Ti.UI.createTableViewRow({height:50, _date_var: date});
    

    it can just be attached as a property and retrieved like this

    row._date_var