[Dojo-interest] Change appearance of a Dijit Tree item

Markus Muetschard markus at muet.com
Mon Oct 24 23:48:23 EDT 2016


...how about adding a class / style to the dijit__TreeNode_6 (after tree
loaded)? (For tree loaded event see examples in doc).

To get the the idea, run programmatic example in doc at
https://dojotoolkit.org/reference-guide/1.10/dijit/Tree.html, then inspect
Europe... from the inspect's ItemNode find the TreeNode up the DOM
hierarchy. There you apply the style (edit DOM node in browser), for
example, 'style="border: 1px red solid;".

In your html you then define the a class in styles.

.thisWeek { border: 1px red solid; }

In JS you apply:

domClass.add("dijit__TreeNode_6","thisWeek");

Doing it with hard-coded or sequence derived id may not be the smartest
way... therefore:

domClass.add(dijit.byId(treeId)._itemNodesMap[itemId],"thisWeek");

...with treeId being the id you give to the tree and nodeId, and itemId the
week id (week object's id).



On Mon, Oct 24, 2016 at 1:23 PM, Harry Devine <lifter89 at comcast.net> wrote:

> I have a site that manages an office football pool, and it uses a Dijit
> Tree to show the different weeks of the season.  I'd like to have the
> current week (i.e Week 6) to either be a different color or font so that it
> stands out to the user which week the season is on.  I can't seem to find a
> way to do that as I'm assigning the ObjectStoreModel object a Dojo Memory
> Store that I create that has each week in the store.
>
>
> I can create a JSFiddle to illustrate what I'm doing if that will help,
> just let me know.  But how can I change the appearance of a tree node at
> run time, or dynamically?
>
>
> Thanks!
>
> Harry
>
> --
> Dojo Toolkit: http://dojotoolkit.org/
> Tutorials: http://dojotoolkit.org/documentation/
>
> Dojo-interest at mail.dojotoolkit.org
> To unsubscribe, visit: http://mail.dojotoolkit.org/
> mailman/listinfo/dojo-interest
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.dojotoolkit.org/pipermail/dojo-interest/attachments/20161024/e1232123/attachment.htm 


More information about the Dojo-interest mailing list