i am trying to pass a data from controller to existing view , i have tried following but non of them are working , i want to pass a data so that i can show it over an existing panel.
from controller
1. Ext.Viewport.setActiveItem('profileinfo');
Ext.Viewport.setData(record.data);
2. Ext.Viewport.setActiveItem('profileinfo').setData(record.data);
3. Ext.Viewport.setActiveItem('profileinfo', {data:record.data});
4. Ext.Viewport.setActiveItem({ xtype:'profileinfo', data:record.data});
where profileinfo
is the panel where there is a titlebar
and i am displaying title
as {member_data}
which is part of data
loadList:function(me, index, target, record, e, eOpts){
console.log(record.data.member_name);
Ext.Viewport.setActiveItem({
xtype:'profileinfo',
data:record.data}
);
}
i can see in my profileinfo
panel's initialize
function that data
is available
but i am not be able to access it using {member_name}
initialize: function(){
this.callParent();
console.log("initialized");
console.log(this.config.data); // able to see the data
}
but data is not reflected in panel
{
xtype:'titlebar',
title:'{member_name}' // its displaying {member_name} text rather then data itself
}
update
here is the profileinfo
code
Ext.define('demo.view.ProfileInfo', {
extend: 'Ext.form.Panel',
xtype: 'profileinfo',
requires: [ 'Ext.TitleBar','demo.view.ProfileMemberInfo'],
config: {
layout:'vbox',
items: [
{
xtype: 'titlebar',
title: 'demo',
cls: 'bms-bg-head',
height:'65px',
center:true,
html:'<div class="demo-mini-logo"></div>'
},{
xtype:'label',
// nothing is visible here
html:'{member_name}'
}]
},
initialize: function(){
this.callParent();
// record is visible
console.log(this.config.record);
}
});
here is controller code
loadList:function(me, index, target, record, e, eOpts){
Ext.Viewport.setActiveItem({
xtype:'profileinfo',
record:record
}
);
}