Titanium Community Questions & Answer Archive

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

TableViewRow Disable Click

Hi,

I want to use tableViewRow control just to display items on it and not a clickable link to navigate to another window/view. But how do i remove the orange selected thing that appears and the border like thing from it in android for this purpose? i do not want to navigate anywhere from that current tableViewRow. It is just for display purpose? Is that a way around that?

— asked April 7th 2010 by sanchit sharma
  • android
  • mobile
0 Comments

3 Answers

  • Try setting selectionStyle:'none'.

    — answered April 7th 2010 by James K
    permalink
    4 Comments
    • I had a similar issue where 'touchenabled' was not working. Setting the selection style to none took away the interactivity that the button had, however it still functions. I still haven't found a solution.

      — commented February 3rd 2011 by Scott Millar
    • finnaly, something i've been looking for, for ages, tnx

      — commented May 13th 2011 by Kami -
    • Yes it works on Android! Thank you. :)
      The Titanium documentation, however, says it's only available for iPhone and iPad. Which is really weird.

      — commented June 21st 2012 by Sufian Babri
    • Actually it didn't work on Android. Lets hope this functionality can be implemented by Ti in the near future.

      — commented June 21st 2012 by Sufian Babri
  • you can try the parameter touchEnable: false but then you cant interact with it.

    To get rid of the arrow like icon on the right you need to set hasChildren:false

    I dont kbow what you mean by orange selected thing? i dont see it, can you shot me a screenshot?

    — answered April 7th 2010 by Glenn Tillemans
    permalink
    0 Comments
  • As you can see below, all four rows are TableViewRow (dateTimeRow, rowHeadline, rowDescription & rowCredit). Selecting any of these rows in android makes it selectable despite of all the parameters i have passed with orange selected color appearing on it. I just want to know how do i get rid of it.

    I will try to attach screen shot below although i am not too sure how to do that.

    var dateTimeRow = Ti.UI.createTableViewRow({className:'a', height:'auto',touchEnabled:false,selectedBackgroundColor:'Black',borderWidth:0,borderColor:'Black',selectionStyle:'none',hasChildren:false });
                dateTimeRow.add(labelDateTime);
                detailedData[x++] = dateTimeRow;
    
                var rowHeadline = Ti.UI.createTableViewRow({className:'b', height:'auto',touchEnabled:false,selectedBackgroundColor:'Black',borderWidth:0,borderColor:'Black',selectionStyle:'none',hasChildren:false });
                rowHeadline.add(labelHeadline);
                detailedData[x++] = rowHeadline;
    
                var rowDescription = Ti.UI.createTableViewRow({className:'c', height:'auto',touchEnabled:false ,selectedBackgroundColor:'Black',borderWidth:0,borderColor:'Black',selectionStyle:'none',hasChildren:false});
                rowDescription.add(labelDescription);
                detailedData[x++] = rowDescription;
    
                var rowCredit = Ti.UI.createTableViewRow({className:'d', height:'auto',touchEnabled:false,selectedBackgroundImage:'Black',borderWidth:0,borderColor:'Black',selectionStyle:'none',hasChildren:false });
                rowCredit.add(labelCredit);
                detailedData[x++] = rowCredit;
    
                var tableview = Titanium.UI.createTableView({ data: detailedData});
                w.add(tableview);
    

    Image

    — answered April 7th 2010 by sanchit sharma
    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.