Titanium Community Questions & Answer Archive

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

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?

— asked November 15th 2010 by Connor Zwick
  • tableview
0 Comments

6 Answers

  • tableView.data[0].rows[6]
    

    rocksteady,
    danno~

    — answered November 15th 2010 by danno watts
    permalink
    0 Comments
  • That seems to crash the emulator…

    — answered November 15th 2010 by Connor Zwick
    permalink
    1 Comment
    • it would help if you post the code you are using ( not as a comment, but as an answer in the box at the bottom of the page ) so we can see what you're using currently.

      — commented November 16th 2010 by danno watts
  • Why can't you do something like:

    tableView.addEventListener('click', function(e) {
      if (e.index == 6) {
        doSomeStuff();
      }
    });
    
    — answered November 15th 2010 by Kevin Whinnery
    permalink
    0 Comments
  • 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.

    — answered November 15th 2010 by Connor Zwick
    permalink
    0 Comments
  • As far as I know, the rowAtIndex function is still broken.

    See solution here.

    — answered November 16th 2010 by James K
    permalink
    0 Comments
  • 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
    
    — answered November 16th 2010 by Jacob van Dam
    permalink
    0 Comments
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.