PDA

View Full Version : hello^^. i need help.



kjcr
5 Nov 2012, 5:27 PM
I use accordian panel
as you know, each items has it's own title.
I want to attach image.
my code is shown below.

the image is attached by result of data.

eventually i need draw image on title of items according to result of data.

help me please.
thanx :)


var sub_Panel = Ext.create('Ext.panel.Panel',{
//store:link_Result_main,
layout:'accordion',
items:[{
title:'SNS'
},{
title:'RefDM'
},{
title:'C019'
},{
title:'ICN'
},{
title:'AVEE'
},{
title:'CSN'
}]
});

vietits
5 Nov 2012, 11:10 PM
Each item is a panel so you can config icon or iconCls to display an icon to the left of panel title.

kjcr
7 Nov 2012, 6:53 PM
thanx but i mean accordian title.
below image is what i mean

i want to insert some image into location of 'here'.

and there are more problems.

i want to change that image according to data.

is anyone has solutions?:)
39905

vietits
7 Nov 2012, 7:40 PM
Try this:


Ext.onReady(function(){
var panel = Ext.create('Ext.panel.Panel',{
renderTo: Ext.getBody(),
width: 300,
height: 300,
//store:link_Result_main,
layout:'accordion',
items:[{
title:'SNS',
header: {
listeners: {
render: function(header){
header.insert(header.items.length - header.tools.length, {
xtype: 'image',
src: 'images/panel-image.png',
width: 50,
height: 16
});
}
}
}
},{
title:'RefDM'
},{
title:'C019'
},{
title:'ICN'
},{
title:'AVEE'
},{
title:'CSN'
}]
});

kjcr
7 Nov 2012, 8:03 PM
everytime~^^ thanx a lot!