jQuery UI Widgets › Forums › Navigation › Tree › Change theme
Tagged: #jquery-tree, javascript tree, jqwidgets tree, Tree
This topic contains 6 replies, has 2 voices, and was last updated by crissi 7 years, 5 months ago.
-
AuthorChange theme Posts
-
Hello!
I’d like to change the theme of an expanded jqxTree out from a selected item.
The theme for the tree is changed, but the selected item does not change.
Any hints, please!Thank you
ChrisHello Chris,
I would like to suggest you look at this topic:
http://www.jqwidgets.com/community/topic/change-font-color-of-one-item-in-tree/
If you want simply to change the style of a selected item you could use class –jqx-tree-item-selected
.
Please, take a look at this example.Best Regards,
Hristo HristovjQWidgets team
http://www.jqwidgets.comHi Hristo,
Thanks for your response.
I understand the 2 links you’ve postet, but I don’t think, that will help.I have a tree with 4 items, id from 0 to 3. Lets say the theme of the tree is orange.
Hover has orange background, selected has blue background.
Lets select id 3, from there I can change the tree’s theme and set it to shinyblack.
Now the items 0 – 2 have an other hover and selected background color (from the shinyblack theme). But id 3 is still “selected” and has blue background, even if I select another id from the tree.
How can I resolve this?
Do I realy have to pick up the values from css “manualy” and set the tree item id 3 to that?Chris
Hello Chris,
I would suggest you save the selected item after that change the theme, re-render (use
render
method) the Tree and then useselectItem
method to select the old element.Best Regards,
Hristo HristovjQWidgets team
http://www.jqwidgets.comYou mean like:
$(‘#mainmenu’).jqxTree({ theme: ‘orange’});
$(‘#mainmenu’).jqxTree(‘render’);
var item = $(‘#mainmenu’).find(“#18”)[0];
$(“#mainmenu”).jqxTree(‘selectItem’, item);That doesn’t work. The same result as before (selected item is not refeshed)
Hello Chris,
Thanks again for your assistance and for this feedback.
I try to recreate this example and it appears strange behavior there.
I will create a work item for this case.Best Regards,
Hristo HristovjQWidgets team
http://www.jqwidgets.comFinaly I resolved it like this:
after changing theme I remove classes “jqx-fill-state-pressed-” + oldtheme, “jqx-menu-item-top-hover-“+ oldtheme
and add the classes “jqx-fill-state-pressed-” + newtheme, “jqx-menu-item-top-hover-” + newtheme;Like this it’s working for me.
-
AuthorPosts
You must be logged in to reply to this topic.