Double click required to click link in table after filter #685

Closed
dmmusil opened this Issue Jul 16, 2014 · 10 comments

Comments

Projects
None yet
4 participants
@dmmusil

dmmusil commented Jul 16, 2014

I use the tablesorter, filter, and pager together. When I filter one column and then attempt to click a link in the filtered table, nothing happens except that the filter input loses focus. Clicking a second time activates the link and takes me to its destination.

Is this a bug or is there a setting I should be using to avoid this?

Here is my setup:

    $(function () {
    var pagerOptions = {
        container: $(".pager"),
        output: '{startRow} - {endRow} / {filteredRows} ({totalRows})',
        removeRows: false,
        fixedHeight: true,
        cssGoto: '.gotoPage',
        size: 20,
        cssPageSize: '.pagesize',
    };

    $("#jobs").tablesorter(
        {
            textSorter: {
                0: $.tablesorter.sortNatural
            },
            sortList: [[0, 0]],
            widgets: ["filter"],
            widgetOptions: {
                filter_columnFilters: true,
                filter_ignoreCase: true,
                filter_hideFilters : false
            }
        }
    ) // Make the table sortable



    .tablesorterPager(pagerOptions);
});
@Mottie

This comment has been minimized.

Show comment Hide comment
@Mottie

Mottie Jul 16, 2014

Owner

Hi @dmmusil!

It appears to work for me.

I created this demo that includes random links in the "English" column. When you click on a link, it opens the original tablesorter pager demo (blackice theme) on the first click. I used the same origin in the links to prevent issues with the iframe same origin policy setting on demo sites similar to jsFiddle (e.g. if I set the links to google, they won't work, but they will show a console message notifying you of the same origin policy setting).

Owner

Mottie commented Jul 16, 2014

Hi @dmmusil!

It appears to work for me.

I created this demo that includes random links in the "English" column. When you click on a link, it opens the original tablesorter pager demo (blackice theme) on the first click. I used the same origin in the links to prevent issues with the iframe same origin policy setting on demo sites similar to jsFiddle (e.g. if I set the links to google, they won't work, but they will show a console message notifying you of the same origin policy setting).

@dmmusil

This comment has been minimized.

Show comment Hide comment
@dmmusil

dmmusil Jul 16, 2014

Repro here: http://jsfiddle.net/95mYt/

Click the filter input on the first column.
Enter 1 in the input.
Try to click the link for student01.

I have to click it twice to activate the link.

Thanks!

dmmusil commented Jul 16, 2014

Repro here: http://jsfiddle.net/95mYt/

Click the filter input on the first column.
Enter 1 in the input.
Try to click the link for student01.

I have to click it twice to activate the link.

Thanks!

@Mottie Mottie added Next Update and removed Works for me labels Jul 16, 2014

@Mottie

This comment has been minimized.

Show comment Hide comment
@Mottie

Mottie Jul 16, 2014

Owner

Ahh ok, I see the problem now. The search input change event is stopping the link from working the first time. I'll have it fixed soon.

Owner

Mottie commented Jul 16, 2014

Ahh ok, I see the problem now. The search input change event is stopping the link from working the first time. I'll have it fixed soon.

@dmmusil

This comment has been minimized.

Show comment Hide comment
@dmmusil

dmmusil Jul 16, 2014

Thank you!

dmmusil commented Jul 16, 2014

Thank you!

@TheSin-

This comment has been minimized.

Show comment Hide comment
@TheSin-

TheSin- Jul 16, 2014

Collaborator

the fix has been tested and fixes the issue for me. Bare in mind that is the search filter has changed and live search is not on, the search will still happen before the click making the data the click as on unavailable, there is no way around this.

Collaborator

TheSin- commented Jul 16, 2014

the fix has been tested and fixes the issue for me. Bare in mind that is the search filter has changed and live search is not on, the search will still happen before the click making the data the click as on unavailable, there is no way around this.

@Mottie Mottie added Widget and removed How To... labels Jul 16, 2014

@dmmusil

This comment has been minimized.

Show comment Hide comment
@dmmusil

dmmusil Jul 16, 2014

Works great, thanks guys!

dmmusil commented Jul 16, 2014

Works great, thanks guys!

@dmmusil dmmusil closed this Jul 16, 2014

@Mottie Mottie removed the Next Update label Jul 17, 2014

@miksteri

This comment has been minimized.

Show comment Hide comment
@miksteri

miksteri May 28, 2015

I'm still experiencing this issue. I have tried earlier and latest versions.

So, when i search and try to click item link it does not work. If i search and click anywhere else first and then click link it works, but not straigth when clicking a item link while focus is in search box.

I'm still experiencing this issue. I have tried earlier and latest versions.

So, when i search and try to click item link it does not work. If i search and click anywhere else first and then click link it works, but not straigth when clicking a item link while focus is in search box.

@Mottie

This comment has been minimized.

Show comment Hide comment
@Mottie

Mottie May 28, 2015

Owner

Hi @miksteri!

Can you provide a demo if this issue? If the links require javascript to work, then it would be best to use delegated event bindings. Here is an example:

$( 'table' ).on( 'click', '.external-links', function() {
    // do something
});
Owner

Mottie commented May 28, 2015

Hi @miksteri!

Can you provide a demo if this issue? If the links require javascript to work, then it would be best to use delegated event bindings. Here is an example:

$( 'table' ).on( 'click', '.external-links', function() {
    // do something
});
@miksteri

This comment has been minimized.

Show comment Hide comment
@miksteri

miksteri Jun 3, 2015

Now I found a version that the links works correctly:
/*! tableSorter 2.16+ widgets - updated 4/23/2014 (v2.16.0)

I don't know the reason why other version didn't work.

miksteri commented Jun 3, 2015

Now I found a version that the links works correctly:
/*! tableSorter 2.16+ widgets - updated 4/23/2014 (v2.16.0)

I don't know the reason why other version didn't work.

@Mottie

This comment has been minimized.

Show comment Hide comment
@Mottie

Mottie Jun 3, 2015

Owner

Please provide a demo of the issue.

Owner

Mottie commented Jun 3, 2015

Please provide a demo of the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment