How to control dojo widget classes, or how to get fine-grained control of style

Posted by djna on Stack Overflow See other posts from Stack Overflow or by djna
Published on 2010-04-14T10:17:21Z Indexed on 2010/04/14 12:53 UTC
Read the original article Hit count: 261

Filed under:
|

I am creating a UI with dojo that is emulting some aspects of an existing thick client application. I need to programatically put two different menu bars on the same page. I have successfully created the two menu bars using

new dijit.Menu();
new dijit.MenuItem();

and so on. Now I want to give them slightly different presentation styles. As I'm going to have quite a few pages of this sort my first thought is to use different CSS style classes. And that's the problem: when I create the Menu and it's items we get quite a set of HTML objects, each with CSS classes specified by dojo, and the classes are the same for the items associated with either menu. How can I best get specific control for any one menu?

I could determine the dojo-generated ids for each item, and specify styles by ids, but that seems like hard work. Is there an sensible way to control the classes defined by dojo, or a nice CSS way to select only the items associated with one menu bar?

© Stack Overflow or respective owner

Related posts about dojo

Related posts about css