PDA

View Full Version : ToolTip problem



mcadirci
12 Sep 2010, 11:40 PM
Hello,

I have a tree panel just like in the api example. Have also expand-all collapse-all buttons. But there is a little problem with the tooltips of the buttons.

Here is my code:

Ext.extend(ApiPanel, Ext.tree.TreePanel, {
initComponent: function(){
this.hiddenPkgs = [];
Ext.apply(this, {
tbar:[ ' ', new Ext.form.TextField({
width: 80,
emptyText:'<fmt:message key="Plate"></fmt:message>',
enableKeyEvents: true,
listeners:{
render: function(f){
this.filter = new Ext.tree.TreeFilter(this, {
clearBlank: true,
autoClear: true
});
},
keydown: {
fn: this.filterTree,
buffer: 350,
scope: this
},
scope: this
}
}), ' ', ' ','-',
{
iconCls: 'icon-expand-all',
tooltip: '<fmt:message key="ExpandAll"/>',
handler: function(){ this.root.expand(true); },
scope: this
}, '-', {
iconCls: 'icon-collapse-all',
tooltip: '<fmt:message key="CollapseAll"/>',
handler: function(){ this.root.collapse(true); },
scope: this
}]
})
ApiPanel.superclass.initComponent.call(this);
},
filterTree: function(t, e){
var text = t.getValue();
Ext.each(this.hiddenPkgs, function(n){
n.ui.show();
});
if(!text){
this.filter.clear();
return;
}
this.expandAll();
var re = new RegExp('^' + Ext.escapeRe(text), 'i');
this.filter.filterBy(function(n){
if( ! n.isLeaf() ){
return true;
}
return (-1!=n.text.indexOf(text));
});
}
});
I have added the tool tips to the ext-all.css from docs.css


.x-window-dlg .ext-mb-error {
background-image:url(../images/default/window/icon-error.gif);
}
.icon-expand-all {
background-image: url(../../docs/resources/expand-all.gif) !important;
}
.icon-collapse-all {
background-image: url(../../docs/resources/collapse-all.gif) !important;
}
What can be the problem? And is there any quick fixes for this problem? Thanks alot.

Thanks.

--
Mehmet

Animal
12 Sep 2010, 11:52 PM
Why indent your code randomly? Can't you see that it makes it almost impossible to rapidly comprehend?

mcadirci
13 Sep 2010, 12:03 AM
Hello again,

I have tried to fix the indentation.

Thanks.

--
Mehmet

Condor
13 Sep 2010, 12:03 AM
What exactly is the problem with the tooltips?

Did you call Ext.QuickTips.init() at the start of your Ext.onReady handler?

ps. I recommend using jsbeautifier.org (http://www.jsbeautifier.org/) on your code.

mcadirci
13 Sep 2010, 12:15 AM
Hello Condor,

Thanks alot for the help. This was the problem.

Thanks alot.

--
Mehmet