Titanium Appcelerator Quickie: Toggling Object in TableViewRow - Clearly Innovative | Web and Mobile DevelopmentClearly Innovative | Web and Mobile Development

So… basic problem statement, we have a checkBox, switch, button… whatever that we need to capture the click event and keep some state information about the object. I want to be able to click the object, save its state and not impact the rest of the items in the row.

I also need a way to find out which items are selected, since multiple items could be selected and it is the object that is selected not the row.

The first example is pretty straight forward, but then there are additional methods that I have added as a possible way to solve additional problems that come up when working with tables and objects in rows

http://gist.github.com/1290599

In the table above, we are able to find the child elements because we know where we put it; also there is only one element.

If there are multiple elements, one solution is to provide ids and then use a function like the one below to iterate through the child objects and find the one you are looking for.

http://gist.github.com/1290638

Another thing that might come in handy is a method for finding which elements are selected

http://gist.github.com/1290645

Final Solution with helpers included to show more fun stuff

http://gist.github.com/1290632