PDA

View Full Version : Box Component, dynamic tool tip



lethalpunch
1 Mar 2013, 4:45 AM
hey guyz i want to add a dynamic tooltip in my box component that changes with the change of its parent name.
please help..
thanx in advance

sword-it
1 Mar 2013, 9:38 AM
Hi,
You can add dynamic tooltip to any item by creating new instance of Ext.ToolTip class. You just need to define the target & html config of the instance according to your self.As you said that you want to change the tooltip of any box component on that's parent value change. After that you can call a function to change the tooltip. Review the following code:



function changeTooltip(){
var boxCmp = Ext.getCmp('id-of-boxCmp');
if(boxCmp){
(boxCmp.tooltip){ // if already any tooltip added than first remove that
boxCmp.tooltip.destroy();
}
// then add new tooltip
boxCmp.tooltip = new Ext.ToolTip({
target: 'id-of-boxCmp'
, html: 'this is dynamic tooltip'
})
}
}

lethalpunch
8 Mar 2013, 1:08 AM
It resolved my prob.