O'Reilly logo

Learning Ext JS 4 by Armando Gonzalez, Crysfel Villa

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 also add nodes dynamically to our tree panel. This is very handy because in most cases when we use the tree panel we will end up facing this requirement. Here, we will see how we can solve the problem in a fast and easy way.

In the following example we are going to add nodes dynamically to our tree panel taking advantage of our previous drag-and-drop example:

/** * @classApp.view.NodeForm * @extendsExt.form.Panel * @author Armando Gonzalez <iam@armando.mx> * The node form panel */ Ext.define('App.view.NodeForm', { extend: 'Ext.form.Panel', xtype:'nodeform', border:false, frame:true, initComponent : function(){ var me = this; me.items = me.buildItems(); me.buttons = me.buildButtons(); me.callParent(); }, buildItems ...

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