jQuery UI Widgets Forums Navigation Tree Change theme

This topic contains 6 replies, has 2 voices, and was last updated by  crissi 7 years ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Change theme Posts
  • Change theme #94125

    crissi
    Participant

    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
    Chris

    Change theme #94171

    Hristo
    Participant

    Hello 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 Hristov

    jQWidgets team
    http://www.jqwidgets.com

    Change theme #94177

    crissi
    Participant

    Hi 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

    Change theme #94216

    Hristo
    Participant

    Hello Chris,

    I would suggest you save the selected item after that change the theme, re-render (use render method) the Tree and then use selectItem method to select the old element.

    Best Regards,
    Hristo Hristov

    jQWidgets team
    http://www.jqwidgets.com

    Change theme #94222

    crissi
    Participant

    You 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)

    Change theme #94247

    Hristo
    Participant

    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 Hristov

    jQWidgets team
    http://www.jqwidgets.com

    Change theme #94250

    crissi
    Participant

    Finaly 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.

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.