Extjs 4 add toolbar to dockeditems run-time panel

I want to create a dockedItem toolbar after creating the panel:

Ext.onReady(function() { Ext.create('Ext.container.Viewport', { layout: 'border', items: [{ region: 'center', xtype: 'panel', listeners: { afterrender: function(panel) { //Below gives: Uncaught TypeError: Object #<Object> has no method 'getItemId' panel.dockedItems.add({ xtype: 'toolbar', dock: 'bottom', items: [{ text: 'adfsadf' }] }); } } }, { region: 'west', title: 'west', html: 'west', width: 120 }, { region: 'east', title: 'east', html: 'east', width: 120 }, { region: 'north', html: 'north', title: 'north', height: 60 }, { region: 'south', html: 'south', title: 'south', height: 60 }] }); }); 

Error:

 Uncaught TypeError: Object #<Object> has no method 'getItemId' 

Any ideas on how to do this?

+4
source share
1 answer

Nothing ... was easier than I thought.

Decision:

 panel.addDocked({ ... }); 
+9
source

Source: https://habr.com/ru/post/1386105/


All Articles