views:

542

answers:

2

I tried the following, but it didn't seem to work.

var helpIcon = dojo.create("span", {"class":"help-icon", innerHTML:"[?]"}, td1);
var tooltip = new dijit.Tooltip({
        connectId: [helpIcon],
        label: "large paragraph of text here ... "
    });
tooltip._setStyleAttr("max-width: 100px");

Help!

+1  A: 

Through experimentation, I found that this works:

.dijitTooltip {max-width: 50em;}

Robert
A: 

Note that style modifications apply to all the tooltips on the page. Dojo creates (when required) 1 common dijit._MasterTooltip object that holds tooltip's dom nodes, and all tooltips use it. The following code adds custom css classes to the rooltips's container and connector.

if(!dijit._masterTT)
    dijit._masterTT = new dijit._MasterTooltip();
// Add a css class to the container
if(dijit._masterTT.domNode.childNodes[0])
    dojo.addClass(dijit._masterTT.domNode.childNodes[0], "classContainer");
// Add a css class to the connector
if(dijit._masterTT.domNode.childNodes[1])
    dojo.addClass(dijit._masterTT.domNode.childNodes[1], "classConnector");
Kniganapolke