PDA

View Full Version : Ext.view.View error "no method addBodyCls"



amsoft2001
14 Jan 2014, 2:14 AM
Hi,

I am trying to add a dataview inside an accordion and I am getting the above error. I am following MVC pattern.

Here are the parent accordion view and the dataview that will be added inside the accordion as an item.


Ext.define('AM.view.RightPanel', {
extend: 'Ext.panel.Panel',
alias: 'widget.MainRightPanel',
layout: 'accordion',
items: [
{
title: 'Recent Capture',
xtype: 'RecentCaptureGridDataPanel',
itemId: 'gdvRecentCapture',
iconCls: 'recent-capture-icon',
},
{
title: 'Control Alerm',
html: 'Panel content!',
iconCls: 'control-alerm-icon',
},
{
title: 'Tracker No',
xtype: 'UserTrackerInfoPanel',
iconCls: 'reports-icon',
}
]
})



Ext.define('AM.view.RecentCaptureGridData', {
extend: 'Ext.view.View',
alias: 'widget.RecentCaptureGridDataPanel',
baseCls: 'recent-capture-grid-panel',
bodyStyle:{
padding:'0 0 0 0',
margin:'45px 0 0 0'
},
config: {
itemTpl: [
'<div><img src="{ImagePath}" /></div>'
].join('')
}
});


Instead of dataview if I use an gridview it works, but as soon as I change the component to dataview, I get the error :( Any suggestion ?

evant
14 Jan 2014, 3:09 AM
You need to wrap it in a panel, the accordion uses the panel header.

amsoft2001
14 Jan 2014, 8:32 AM
Spot on ! :) Thanks a million