PDA

View Full Version : Conditionnal Hide tool tip



extjs_Beginner
23 Sep 2015, 11:55 PM
Hi everyone,

I have a tool tip on my stacked bar chart
I need to hide some tool tip (when tip is equal to some values)
I tried hide(), setVisible(false) but its not working
This is my code :


series:
[
{
type: 'bar',
stacked: true,
highlight: false,
showInLegend: false,
xField: ['LineData'],
yField: me.objChartFieldList,
renderer: function (sprite, record, attributes, index, store) {
attributes = Ext.apply(attributes, {
fill: me.objChartFieldListColor[index]
});
return attributes;
},
xPadding: {left:0,right:0},
yPadding: 0,
tips: {
id: 'serieTips' + me.id,
trackMouse: true,
autoHide : true,
width: 160,
disabled : false,
renderer: function(storeItem, item) {
var index = item.yField.substring(1,5);
var currentSerieTips = Ext.getCmp('serieTips' + me.id);

if(index == 'ineD') {index = 0;} else {index++;}

var tipsTxt = me.objChartFieldListTips[index];

if(tipsTxt != 'empty' && tipsTxt != 'begin'){
this.setTitle(tipsTxt);

}
else
{
this.setTitle(' ');
currentSerieTips.hide(true);
// currentSerieTips.setDisabled(true);
// currentSerieTips.disable();
currentSerieTips.setVisible(false);
// this.setWidth(10);
// currentSerieTips.setPosition(0,0,{
// duration: 100,
// to: {
// opacity: 0.5
// }});
}
}
}
}
]

With Opacity it seems works but as soon as the opacity is enabled it remains for next tool tip

slemmon
7 Oct 2015, 10:43 AM
Try configuring a beforeshow listener on the tip.
http://docs.sencha.com/extjs/4.2.3/#!/api/Ext.tip.ToolTip-event-beforeshow

Return false from that listener if the condition is met to prevent the tip from showing.