コントローラーから既存のビューにデータを渡そうとしています。以下を試しましたが、どれも機能していません。既存のパネルに表示できるようにデータを渡したいです。
コントローラから
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});
があり、データの一部として表示されてprofileinfo
いるパネルはどこですかtitlebar
title
{member_data}
loadList:function(me, index, target, record, e, eOpts){
console.log(record.data.member_name);
Ext.Viewport.setActiveItem({
xtype:'profileinfo',
data:record.data}
);
}
profileinfo
使用可能なパネルのinitialize
機能を確認data
できますが、使用してアクセスできません{member_name}
initialize: function(){
this.callParent();
console.log("initialized");
console.log(this.config.data); // able to see the data
}
しかし、データはパネルに反映されません
{
xtype:'titlebar',
title:'{member_name}' // its displaying {member_name} text rather then data itself
}
アップデート
ここにprofileinfo
コードがあります
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);
}
});
ここにコントローラーコードがあります
loadList:function(me, index, target, record, e, eOpts){
Ext.Viewport.setActiveItem({
xtype:'profileinfo',
record:record
}
);
}