Add the User View

Finally, you add a simple page view that displays a selected customer’s details. This view is the second page in this app. The customer navigates to it by tapping an item in the Users list view. The user-page template defines a Back button that returns the customer to the search list.

  1. Immediately after the UserListItemView view definition, create the view for a customer’s details. Extend Backbone.View again. For the remainder of this procedure, add all code in the extend({}) block.

  2. Specify the template to be instantiated.

  3. Implement a render() function. This function re-reads the model and converts it first to JSON and then to HTML.

Here’s the complete extension.