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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.