The selectRow function works perfectly on iOS but on Android I get the following error: Uncaught TypeError: Object [object TableView] has no method 'selectRow'.
The process I go through is to first create the table view, then set the table data, then call the selectRow function.
I'm using Titanium Studio, build: 2.1.2.201208301612 and SDK 2.1.3.GA
2 Answers
Hi Robin, you seems to be right, i did not right code to test but i checked the documentation which is not having any platform dependencies then i checked the kitchen sink app where also they have just implemented for iOS. so you can do one thing create a ticket in JIRA and put your code there as reference.
Hey Guys,
Sorry for not posting code ... I got a much better solution than relying on the system selectRow function. I just have a row content container view and set the background color on the container instead of the row. That way I have complete control over which rows are selected, the color of the selected rows (instead of the system applying it's default color), I can track selected row item ID's (not just row indexes) in an array and have multiple rows "selected" at once.
Just a tip for those who stumble upon this post ...
In iOS you must set the background color directly on the TableViewRow object (not on the row content container view), otherwise the iOS deselect animation will interfere with the container's background color.
However, in Android you must set the background color on the row content container view (not on the TableViewRow object) otherwise Android will reload the entire table every time the user wants to select a row (which can take ages if you have 1000+ rows in the table like I do). By using a row content container view, Android only refreshes the row content container view instead of reloading the entire table.
Thanks for the responses anyways ... unfortunately, I cannot post my code due to confidentiality agreements with the client.
Your Answer
Think you can help? Login to answer this question!