Reputation: 1015
lets say I have object
var obj = {
xtype: 'panel',
title: 'other panel'
}
And I want to get dynamic panel from it. I want something like this:
var obj = {
xtype: 'panel',
title: 'other panel'
}
var panel = Ext.create(obj); //not work of course
and then bind event
panel.on('added', function(){console.log('hello world'});
how It possible?
Upvotes: 3
Views: 114
Reputation: 74096
Try using Ext.widget
instead, like:
var panel = Ext.widget(obj.xtype, obj);
Upvotes: 3