PDA

View Full Version : Reuse of components in extjs



ruchika
13 Oct 2009, 6:19 AM
I have created a panel with buttons. i want to reuse the btnPan at more then 1 places in my screen. but if i try doing so, it is visible only at the first place where it is called and not at other places.
Am i doing some mistake in coding ? Please suggest how can i reuse the same.


var btnPan = new Ext.Panel({
border:false,
header:false,
width: 50,
height:50,
items: [{
xtype: 'buttongroup',
items: [{
iconCls: 'add7',
iconAlign: 'top',tooltip:'Exchange'
},{
iconCls: 'add8',
iconAlign: 'top'
}]
}]
});

13 Oct 2009, 6:58 AM
You can't use the same instance of panel.

You'll have to create difference instances

ruchika
13 Oct 2009, 7:05 AM
Thanks.

Can you tell me how do i get tooltip for the buttons in a button group. I tried it but its not working.


var btnPanGrid1 = new Ext.Panel({
width: 50,
height:200,
items: [{
xtype: 'buttongroup',
columns: 1,
items: [{
iconCls: 'add',
iconAlign: 'top',tooltip:'Icon1'
},{
iconCls: 'add1',
iconAlign: 'top',tooltip:'Icon2'
},{
iconCls: 'add2',
iconAlign: 'top',tooltip:'Icon3'
}]
}]
});

13 Oct 2009, 7:07 AM
did you call Ext.QuickTips.init()?