On September 14th, 2017, we published revised versions of our Privacy Policy, Terms of Service and Website Use Policy and published a Cookie Policy. Your continued use of Lynda.com means you agree to these revised documents, so please take a few minutes to read and understand them.

Starting with the app.js file in the 05-08 folder of the exercise files, I'm…using the finished state of exercise 05-02.…I'll add the editable property of the tableView object and set it to true.…I'll also add the allowSelectionDuringEditing property to the tableView…object and set it to true.…This will allow me to switch back and forth between editing and non-editing mode…while taping the rows.…I'll code an EventListener that will cause the table to enter in editing…mode when the row is clicked.…

This editing mode is available for iOS only.…For Android, I'll cover row deletion later in this movie.…I'll add a callback that says the editing property of the tableView to true, if…it is false and vice versa.…Finally, I'll add an EventListener to the tableView that listens for the delete event.…This will fire when the user taps the Delete button.…

For the callback function, I'll set the editing property of the table back to false.…This will restore the table to non-editing mode.…Let's take a look at the result in the Simulator.…

Resume Transcript Auto-Scroll

Author

Released

2/3/2012

In this course, author Rafael Hernandez creates native iOS and Android applications from a single codebase with the open-source Appcelerator Titanium platform. The course explains the difference between browser-based JavaScript and Titanium JavaScript, shows how to create a basic application, and demonstrates building buttons, sliders, switches, and pickers. The course also covers creating tables, implementing maps, providing feedback to users, incorporating multimedia, detecting gestures, and preparing finished apps for distribution.

Topics include:

Accessing the Titanium API documentation

Navigating the Titanium Studio workspace

Detecting platforms

Understanding windows and views

Listening for events

Configuring text fields

Adding interactivity to a view

Working with a single tab group

Creating a map and setting the location

Adding and removing map pins at runtime

Loading local and remote web pages

Loading an external XML feed

Setting timers

Prompting device vibrations

Implementing an activity indicator

Reading from and writing to the file system

Working with media

Reading device orientation

Detecting gestures

Debugging an app

Stepping through a finished app

Skill Level Beginner

3h 3m

Duration

267,287

Views

Show MoreShow Less

Q: I'm having trouble getting the code in the Chapter 5 "Opening windows from rows" movie to work for Android.

A: There is a difference in the way Android treats a generic object that serves as data for a table. As well, there is no "hasDetail" property for Android table rows. The solution is to:

1.) Rename all the "hasDetail" properties to "hasChild"

2.) Instead of using generic objects in the data array, use Titanium Table Row objects.

As a general note: In order to attach custom properties to rows in Android, Titanium Table Row objects *must* be used. That isn't made clear in the Android docs, especially if the app won't fail if you don't do this as evidenced by the old code. New code is included here that should take care of this issue.

This is how your code should read:

// this sets the background color of the master UIView (when there are no windows/tab groups on it)Titanium.UI.setBackgroundColor('#000');