It's all about the answers!

Ask a question

Adding an icon to a jazz.ui.Button button.


paul boney (11) | asked Feb 04 '09, 3:32 p.m.
JAZZ DEVELOPER
I would like to add a small icon inside of a button that I have created using jazz.ui.Button. Is there built-in functionality to accomplish this, or do I have to use an html anchor tag somewhere?

Thanks!

One answer



permanent link
Rob Retchless (31125) | answered Feb 04 '09, 3:44 p.m.
FORUM ADMINISTRATOR / JAZZ DEVELOPER
The constructor for Button takes an imageClass param. Pass it, and also set a className on your button (to narrow the scope of your CSS).

Example:

var button = new jazz.ui.Button({imageClass: "someClass"});
dojo.addClass(button.domNode, "MyButton");

Then in CSS:

.Mybutton .someClass {
background-image:url(someImage.gif);
width:80px; //tweak this width depending on your image
}

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.