Skip to content

Resize and qtip setting issue on tablesorter with scroll widget #1212

@jrmusa

Description

@jrmusa

Hi @Mottie,
Scroll widget is an useful add-on but I have trouble when:
Q1. I wanna resize table with window size so I write:

var newHeight = 400;
 var updateScroller = function (height) {
        $('.tablesorter-scroller-table').css({
            height: '',
            'max-height': newHeight + 'px'
        });
    }

    $(window).bind("resize", function () {
        if (newHeight > $(window).height())
        {
            newHeight = $(window).height() - 100;
        }
        updateScroller(newHeight);
    }).trigger("resize");

$('#lotyieldtable').tablesorter({
        delayInit: true,
        headerTemplate: "",
        widthFixed: false,
        fixedHeight: true,
        showProcessing: true,
        debug: true,
        widgets: ['scroller'],
        ignoreCase: false,
        widgetOptions: {
            scroller_upAfterSort: true,
            scroller_jumpToHeader: true,
            scroller_height: newHeight,
            scroller_fixedColumns: 1,
            scroller_addFixedOverlay: false,
            scroller_barWidth : null,
            stickyHeaders_offset: 50,
        },
        initialized: function () {
            updateScroller(newHeight);
            setTimeout(function () {
                $('#lotyieldtable').trigger('applyWidgetId', 'stickyHeaders');
            }, 2000);
        }
    });

it doesn't work when I resize the window, not sure what's going on, I follow this demo: http://jsfiddle.net/abkNM/4304/

Q2. Everything is alright if I add qtip on tablesorter, however the frozen column would miss something so that my qtip trigger doesn't work after sorting table, I put a class "tooltip2" on frozen column and it can show tip at the begining, afterward it seems like lost class after sorting table.

function set_qtip() {
    $(".tooltip2").on("mouseover", function () {
        var $this = $(this)
        if (!$this.data("toolTipAttached")) {
            $this.qtip({
                style: {
                    widget: false,
                    classes: 'ui-tooltip-light'
                },
                content: $($(this).attr("data-tooltip")).html(),
                position: {
                    corner: {
                        target: 'topRight',
                        tooltip: 'bottomLeft'
                    }
                }
            });
            $this.data("toolTipAttached", true);
            // the qtip handler for the event may not be called since we just added it, so you   
            // may have to trigger it manually the first time.
            $this.trigger("mouseover");
        }
    });
}

Thanks for support!

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions