Search code examples
jqueryextjsextjs3

Change Ext JS Toolbar orientation (Outside the config)


Is there a painless way to change an Ext JS toolbar orientation? Something like changing a tbar to a bbar (outside the config)

I'm trying to do this in Ext JS 3.4

I know I can override the config and change the toolbar orientation. But I was wondering if there was someone out there who was smart enough to do it with a few lines of code.


Solution

  • The way to change initial config is to pass an overriding config during instantiation. For example if you have a definition of a panel with a tbar:

    Ext.define('MyPanel',{
      extend:'Ext.panel.Panel',
      tbar: [{text:'myButton'}]
      ...
    });
    

    you can override it's config when you instantiate it:

    Ext.create('MyPanel',{
      tbar:undefined,
      bbar: [{text:'myButton'}]
      ...
    });