2

The following code to print the "local" model in tableview, its working, now my problem is to fetch the row id or row detail by clicking the each row. I have attached the showDetail function on each row to get the row detail.But unable to get the row attch data. How can i achieve this please help me, I really appreciate your answers.

<TableView dataCollection="local">
    <TableViewRow onClick="showDetail">
        <View layout="horizontal">
            <ImageView image="{image}" width="50" height="50"/>
            <Label id="name" text="{title}"></Label>
        </View>
    </TableViewRow>
</TableView>


function showDetail(e){
console.log(e.index);
}

enter image description here

maxdangelo
  • 3,063
  • 5
  • 21
  • 25
madhurjya
  • 160
  • 1
  • 9

1 Answers1

1

Have a look at the TableView API click Event:

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

There are all properties: e.g. index=the number of the row

And have a look at row and rowData

miga
  • 3,997
  • 13
  • 45