1

I would like to know whats the difference between TreeGrid and TreePanel components of ExtJS 4?

I was looking for some component which will allow me to display rows and sub rows (for slice and dice kind of dashboard) but couldn't find anything similar in ExtJS 4.

I came across TreeGrid and TreePanel but not sure which one is latest and which to be used?

Please enlighten !

Shekhar
  • 11,438
  • 36
  • 130
  • 186

1 Answers1

3

You want to use Treepanel. I believe treegrid name is a legacy cary over. Here is a very nice clean example of such a beast: http://docs.sencha.com/ext-js/4-0/#!/example/tree/treegrid.html Notice how they did not rename the example :)

dbrin
  • 15,525
  • 4
  • 56
  • 83
  • thanks... It looks like Sencha people have changed xtype from TreeGrid to TreePanel but forgot to rename tutorial name. – Shekhar Feb 03 '12 at 07:18
  • I have one more question. In most of the tutorials Components are created using Ext.Create() method but in their MVC tutorial they are creating components using Ext.define() method. So whats the difference between the two? which way to choose? and why there are two different ways to create components? – Shekhar Feb 03 '12 at 07:20
  • 1
    carefully ready through class system guide. The "create" method give you an instance of a component - it replaces the "new" keyword. The define or extend methods give you definitions or prototypes or classes of your objects. They are not instantiated unless "created" or referred to via xtype config from another object. – dbrin Feb 03 '12 at 07:28