So I am trying replacing an extjs button with an image and have it display some tooltip.
The thing is I just want to display the image and I dont want the background of the extjs button.
Here is my code below.
To get an idea of what I am talking about , here is the js fiddle:
http://jsfiddle.net/nCkZN/7/
CSS:
.question {
background-image: url(../www/css/slate/btn/question.png) !important;
background-repeat: no-repeat;
}
Javascript:
{
xtype: 'button',
iconCls: 'question',
tooltip: "<b>read-only</b>:Read-only users will have read only access to all pages<br> ",
padding: '2 6 2 7',
width: 20,
height: 24
}
EDIT:I replaced the button with text and that shows only the image. But it does not dispaly the tooltip.
{
xtype: 'text',
cls: 'question',
tooltip: "<b>read-only</b>:Read-only users will have read only access to all pagess ",
height: 20,
padding: '12 6 2 7'
}
You can modify the look of the button through CSS http://jsfiddle.net/nCkZN/10/
CSS
you can alternatively use a regular
Ext.Imgand add a tooltip to it. Seems cleaner than using a button when you don’t want a button. http://jsfiddle.net/nCkZN/15/What you really seem to be after is a way to add a tooltip to any component. Here’s a plugin to do it.
Now it’s easy to add a tooltip to any component http://jsfiddle.net/nCkZN/17/