Adding items to a container at runtime

In an application, there would be numerous scenarios where we would have to add components ranging from a simple field to a panel at runtime as part of the response to the user event. For example, your application may have a payment panel where you may want to show the payment specific detail panels based on the payment method. If a user selects Credit Card as the payment method, then you may show a panel asking the user to enter their credit card detail. This requires us to add components dynamically to an existing container. In this recipe, we will see how to work with components at runtime.

Getting ready

Make sure that you have set up your development environment by following the recipes outlined in Chapter ...

Get Sencha Touch Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.