O'Reilly logo

Learning Ext JS - Fourth Edition by Armando Gonzalez, Crysfel Villa, Carlos A. Méndez

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Adding and removing nodes

We can even add nodes dynamically to our tree panel. This is very handy because when we use the tree panel, in most cases, we will end up facing this requirement. Here, we will see how we can solve this problem.

In the following example, we are going to add nodes dynamically to our tree panel. In order to familiarize you with the upcoming chapters that cover this example, we will use MCV architecture. Let's start creating a file to be saved in chapter_09/appcode/view/ as nodeForm.js, and place the following code:

// JavaScript Document
Ext.define('Myapp.view.nodeForm', {
  extend:'Ext.form.Panel',
  alias: 'widget.mynodeForm', requires: [ 'Ext.toolbar.Toolbar', 'Ext.toolbar.Fill', 'Ext.button.Button', 'Ext.form.field.Text', ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required