jQWidgets Forums

jQuery UI Widgets Forums Navigation Tree Scrollposition on Expand

This topic contains 3 replies, has 2 voices, and was last updated by  Hristo 8 years, 2 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • Scrollposition on Expand #91701

    t.knorr
    Participant

    If I expand the tree the scrollposition will jump to top.

    It can be fixed by setting the scroll position manually to the old value at the “slideDown” event.

    Scrollposition on Expand #91702

    t.knorr
    Participant
    $subtree.slideDown(me.animationShowDuration, me.easing,
        function () {
            var scrolltop = $(b.element).scrollTop();       // <---- EDITED
    
            var $arrowSpan = $(item.arrow);
                item.isExpanded = true;
                me._arrowStyle($arrowSpan, "", item.isExpanded);
                item.isExpanding = false;
                me._raiseEvent('0', { element: item.element });
                me._calculateWidth();
            }) //animate subtree into view 
    
            $(b.element).scrollTop(scrolltop);              // <---- EDITED     
    //     }, 0);
    
    $subtree.slideUp(me.animationHideDuration, function () {
        var scrolltop = $(b.element).scrollTop();       // <---- EDITED
    
        item.isCollapsing = false;
        me._calculateWidth();
        var $arrowSpan = $(item.arrow);
        me._arrowStyle($arrowSpan, "", item.isExpanded);
        $subtree.hide();
        me._raiseEvent('1', { element: item.element });
    
        $(b.element).scrollTop(scrolltop);              // <---- EDITED     
    })
    Scrollposition on Expand #91719

    t.knorr
    Participant

    Same has to be done in “render” function

    Scrollposition on Expand #91780

    Hristo
    Participant

    Hello t.knorr,

    Thank you for the interest to our widget.
    We recommend using the API.
    I would like to suggest you this workaround.

    Best Regards,
    Hristo Hristov

    jQWidgets team
    http://www.jqwidgets.com

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

You must be logged in to reply to this topic.