Tableview Getting e.index
Hi,
I'm trying to be able to target a specific tableview row. How can I do that, without an event listener?
For some example what's the id of the 7th row of a tableview. How would I do that?
6 Answers
-
tableView.data[0].rows[6]
rocksteady,
danno~ -
That seems to crash the emulator…
-
Why can't you do something like:
tableView.addEventListener('click', function(e) { if (e.index == 6) { doSomeStuff(); } });
-
Because I'm trying to save the position of tableview rows by having a key value for each row saved into a database, based on the index value of each row. Which means that I need to be able to dynamically pull the order of rows. I apologize if I'm being unclear, please let me know if you need clarification. I've been trying to make this work for over a week now.
-
As far as I know, the
rowAtIndex
function is still broken.See solution here.
-
The 7th row has index 6, because a index always starts counting with 0.
You can access this row by:
yourTable.rowAtIndex(6); //Select row 7, with index 6