Titanium Community Questions & Answer Archive

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

Detail property of TableViewRow 'click' event does not work?

Hi,

as described in docs (http://developer.appcelerator.com/apidoc/mobile/latest/Titanium.UI.TableViewRow-object) a TableViewRow provides a detail property within the click event object. It should be a boolean to indicate if the right area was clicked.

But this property is always false, wherever I clicked. Tried it on Android and iPhone simulator.

Can someone help me or is this a bug?

Thanks in advance

— asked September 26th 2010 by Jicks Steen
  • bug
  • event
  • mobile
  • tableviewrow
1 Comment
  • 2 years passed and I get the same behavior that you described, I think it`s a bug.

    — commented March 1st 2013 by Joao Bertolino

2 Answers

  • You have to add a click listener to the tableview object (not the row), then check for the event.detail boolean ex: if(e.detail == true)

    — answered October 11th 2010 by michael ruddy
    permalink
    0 Comments
  • You have to Tableview event listener instead of row, and check whether the corresponding row is clicked or not using index(e.index) or by creating temporary property(test) like,

    var data = [{title:"Row 1",test:"var1"},{title:"Row 2",test:"var2"}];
    var table = Titanium.UI.createTableView({data:data});
    win.add(table);

    and in event listener find each row individually using (e.Rowdata.test=="var1")or(e.Rowdata.test=="var2")

    in this way TableViewRow 'click' event can be achieved.

    — answered October 11th 2010 by Karthikeyan Chandran
    permalink
    1 Comment
    • Thanks Worked if(e.detail)

      — commented April 29th 2012 by Vishal Rajpal
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.