View Full Version : adding tool tip for dialog button
ligesh
3 Aug 2007, 9:22 AM
Hi,
Is there some way I can add tool tip to the buttons in the dialog boxes? I tried setting the text with a span, but it didn't work.
Thanks.
Rewand
3 Aug 2007, 11:13 AM
If you mean buttons in your own dialogs you can set tooltip text when you construct the button
var b = new Ext.Button('elementID', {tooltip:'click me'});
If you mean the buttons in MessageBox you might not be able to get this. The docs show properties called YESNO, OKCANCEL and YESNOCANCEL which contain config options for the buttons but tooltips need to differ for each button so I'm not sure what to do.
ligesh
3 Aug 2007, 11:27 AM
If you mean buttons in your own dialogs you can set tooltip text when you construct the button
var b = new Ext.Button('elementID', {tooltip:'click me'});
If you mean the buttons in MessageBox you might not be able to get this. The docs show properties called YESNO, OKCANCEL and YESNOCANCEL which contain config options for the buttons but tooltips need to differ for each button so I'm not sure what to do.
Thanks for the info. I am using the pre-built dialog box example that comes with extjs. It adds button directly to the dialog via addButton.
g_okBtn = dialog.addButton('OK', this.okComment, this);
SO I guess a g_okBtn.tooltip = 'click me'; after this would work. I am assuming that tooltip is a variable inside the class button. I am new to Javascript, so pardon my ignorance.
Thanks.
ligesh
3 Aug 2007, 11:56 AM
Thanks for the info. I am using the pre-built dialog box example that comes with extjs. It adds button directly to the dialog via addButton.
g_okBtn = dialog.addButton('OK', this.okComment, this);
SO I guess a g_okBtn.tooltip = 'click me'; after this would work. I am assuming that tooltip is a variable inside the class button. I am new to Javascript, so pardon my ignorance.
Thanks.
It doesn't. I checked the code. The dialog is an instance of the basicDialog class and doesn't seem to have any tooltip defined. In that case, I might have create a new BasicDialog class?
Thanks.
sj137
10 Aug 2007, 7:20 AM
this is strange, i thought i knew the answer to this one:
in the api docs the basicdialog's addbutton method says it will accept a string or button config object as the first argument, but when i tried:
var myBtn = dialog.addButton({text:'My Text',tooltip:'My Tooltip text'}, myMethoid, dialog);
i didn't see a tooltip, is this a bug? or are tooltips not supported for buttons in dialogs and forms...? or what am i doing wrong?
Many thanks in advance
SJ
Troy Wolf
5 Sep 2007, 6:06 AM
I'm an EXT noobie myself, but I am doing this and it works. Perhaps you did not initialize the Quicktips. I do this in my Ext.onReady block:
Ext.QuickTips.init();
I didn't try to check your code fully for errors--I assume you are using a good debugger like Firefox.
Powered by vBulletin® Version 4.1.5 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.