Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#17264 closed defect (worksforme)

dijit.layout.ContentPane: iconClass not working?

Reported by: dtamm Owned by:
Priority: undecided Milestone: tbd
Component: Dijit Version: 1.9.1
Keywords: Cc:
Blocked By: Blocking:

Description

According to the output of my Firebug (Firefox 23), the iconClass Attribute in dijit.layout.ContentPane? still exists and can be used (the value i wanted to assign is the correct one according to the output). But: the attribut does not seem to be computet correctly... the icon won't be shown as the tab icon!

I looked up the API Docs, till Dojo 1.7 the iconClass is shown in the dijit.layout.ContentPane?, but since 1.8 it is not shown anymore (my guess: it's now part of the dijit._WidgetBase). I also looked into the release notes of 1.7, 1.8 and 1.9, if this attribut was removed or sth... but nothing like that is written there.

This is how i tested the behavior:

<div dojoType="dijit.layout.TabContainer">
    <div id="test1" dojoType="dijit.layout.ContentPane" data-dojo-props='title:"Tab 1", iconClass:"addIcon"'></div>
</div>

The equivalent in js would be:

var tab = new dijit.layout.ContentPane({
    iconClass: "addIcon",
    href: "test.html"
});
dijit.byId("tabPane").addChild(tab);
dijit.byId("tabPane").selectChild(tab);

As said, the attribute "addIcon" is assigned correctly to the attribute! But the icon is not shown, though its declared in the css! (the path for the image is loaded correctly).

Is there anything changed according to the iconClass Attribute or is this a bug?

Change History (4)

comment:1 Changed 6 years ago by dtamm

Additional Information: The HTML for the Icon is rendered correctly, but not shown! (Blurred out in the firebug HTML code viewer)

comment:2 Changed 6 years ago by bill

Resolution: worksforme
Status: newclosed

Yes, icons are still supported and are working fine. No examples in the reference guide but you can see them in action in http://download.dojotoolkit.org/release-1.9.0/dojo-release-1.9.0/dijit/tests/layout/test_TabContainer.html.

Not sure what went wrong on your end.

comment:3 Changed 6 years ago by dtamm

i think i see what went wrong in my case: i had to declare an extra css class with height and width attribute... which i had not to declare for the iconClass in dijit.MenuItem?. so i see some kind of inconsistent behaviour here, but thats up to you now :) i got myself a solution for now

comment:4 Changed 6 years ago by bill

OK good... yah it might be that Menu has a default width and height setting which you can inherit if your icons happen to be that width and height. My intention was that user defined CSS classes for icons always specify a width and height, but I suppose having a default is nicer.

Note: See TracTickets for help on using tickets.