Pager widget (no ajax) doesn't work with filtering #668

Closed
TheSin- opened this Issue Jul 2, 2014 · 9 comments

Comments

Projects
None yet
2 participants
@TheSin-
Collaborator

TheSin- commented Jul 2, 2014

http://mottie.github.io/tablesorter/docs/example-widget-pager.html

then run

$('table')[0].config.widgets.push('filter');
$('table').trigger('applyWidgets');

to get filtering

in the Sex filed type Yes... err I mean female.

the pager still says 1 to 10 of 50 rows.

@TheSin- TheSin- added the Bug label Jul 2, 2014

@TheSin-

This comment has been minimized.

Show comment
Hide comment
@TheSin-

TheSin- Jul 2, 2014

Collaborator

just ran some tests, when I sort

sortStart -> pagerComplete -> sortEnd are triggered

when I filter

NOTHING

I assume this is the reason for it all, I'm getting no js errors so I'm not sure why it stopped triggering or where it's bailing out yet. the filter does happen which is odd. I'm going to keep digging. Just wanted to post this.

Collaborator

TheSin- commented Jul 2, 2014

just ran some tests, when I sort

sortStart -> pagerComplete -> sortEnd are triggered

when I filter

NOTHING

I assume this is the reason for it all, I'm getting no js errors so I'm not sure why it stopped triggering or where it's bailing out yet. the filter does happen which is odd. I'm going to keep digging. Just wanted to post this.

@Mottie

This comment has been minimized.

Show comment
Hide comment
@Mottie

Mottie Jul 3, 2014

Owner

I blame you Pikachu!

imgres

errr, I mean I'll look into it.

Owner

Mottie commented Jul 3, 2014

I blame you Pikachu!

imgres

errr, I mean I'll look into it.

@TheSin-

This comment has been minimized.

Show comment
Hide comment
@TheSin-

TheSin- Jul 3, 2014

Collaborator

looks like the fix fixed it ;)

here is the trigger fire order now with this change.

Pager Widget w/Ajax
Startup: pagerComplete -> filterStart -> filterEnd -> filterStart -> filterEnd -> filterStart -> filterEnd -> filterStart -> filterEnd
Do Filter: filterStart -> filterEnd -> pagerComplete

Pager Widget w/o Ajax
Startup: filterStart -> filterEnd -> filterStart -> filterEnd -> filterStart -> filterEnd -> filterStart -> filterEnd
filterStart -> pagerComplete -> filterEnd

No Pager
Startup: filterStart -> filterEnd -> filterStart -> filterEnd -> filterStart -> filterEnd -> filterStart -> filterEnd
filterStart -> filterEnd

  1. The odd part here is that pagerComplete doesn't fire without ajax on start.
  2. The order is out on filter for with or without ajax
Collaborator

TheSin- commented Jul 3, 2014

looks like the fix fixed it ;)

here is the trigger fire order now with this change.

Pager Widget w/Ajax
Startup: pagerComplete -> filterStart -> filterEnd -> filterStart -> filterEnd -> filterStart -> filterEnd -> filterStart -> filterEnd
Do Filter: filterStart -> filterEnd -> pagerComplete

Pager Widget w/o Ajax
Startup: filterStart -> filterEnd -> filterStart -> filterEnd -> filterStart -> filterEnd -> filterStart -> filterEnd
filterStart -> pagerComplete -> filterEnd

No Pager
Startup: filterStart -> filterEnd -> filterStart -> filterEnd -> filterStart -> filterEnd -> filterStart -> filterEnd
filterStart -> filterEnd

  1. The odd part here is that pagerComplete doesn't fire without ajax on start.
  2. The order is out on filter for with or without ajax
@Mottie

This comment has been minimized.

Show comment
Hide comment
@Mottie

Mottie Jul 4, 2014

Owner

Reopening this so I can remember to address the filterStart and filterEnd spam

Owner

Mottie commented Jul 4, 2014

Reopening this so I can remember to address the filterStart and filterEnd spam

@Mottie Mottie reopened this Jul 4, 2014

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

@TheSin-

This comment has been minimized.

Show comment
Hide comment
@TheSin-

TheSin- Jul 4, 2014

Collaborator

http://jsfiddle.net/LR3sX/38/

that's a demo with it, if you enable the pager it doubles the spam as well.

Collaborator

TheSin- commented Jul 4, 2014

http://jsfiddle.net/LR3sX/38/

that's a demo with it, if you enable the pager it doubles the spam as well.

@TheSin-

This comment has been minimized.

Show comment
Hide comment
@TheSin-

TheSin- Jul 15, 2014

Collaborator

http://jsfiddle.net/LR3sX/75/

If I remove filter_formatter (the commented out block) no filterStart/End at all, it's perfect now.

So the last bug here is just to figure out why each filter that uses filter_formatter called filterStart/End on start, aka remove the commented out block and you'll see it fires 2 times once for each.

I know we already know about this I just wanted to document it someplace. filterInit works great BTW.

Collaborator

TheSin- commented Jul 15, 2014

http://jsfiddle.net/LR3sX/75/

If I remove filter_formatter (the commented out block) no filterStart/End at all, it's perfect now.

So the last bug here is just to figure out why each filter that uses filter_formatter called filterStart/End on start, aka remove the commented out block and you'll see it fires 2 times once for each.

I know we already know about this I just wanted to document it someplace. filterInit works great BTW.

@TheSin-

This comment has been minimized.

Show comment
Hide comment
@TheSin-

TheSin- Jul 15, 2014

Collaborator

also enabling the pager starts a filterStart/End as well.

Without pager widget enabled

[Log] sortStart undefined undefined (show, line 78)
[Log] sortEnd undefined undefined (show, line 78)
[Log] filterInit 20 20 (show, line 78)

With Pager widget

[Log] pagerInitialized 20 20 (_display, line 78)
[Log] filterInit 20 20 (_display, line 78)
[Log] pagerComplete 20 20 (_display, line 78)
[Log] sortStart undefined undefined (_display, line 78)
[Log] sortEnd undefined undefined (_display, line 78)
[Log] filterStart undefined undefined (_display, line 78)
[Log] filterEnd 20 20 (_display, line 78)

Collaborator

TheSin- commented Jul 15, 2014

also enabling the pager starts a filterStart/End as well.

Without pager widget enabled

[Log] sortStart undefined undefined (show, line 78)
[Log] sortEnd undefined undefined (show, line 78)
[Log] filterInit 20 20 (show, line 78)

With Pager widget

[Log] pagerInitialized 20 20 (_display, line 78)
[Log] filterInit 20 20 (_display, line 78)
[Log] pagerComplete 20 20 (_display, line 78)
[Log] sortStart undefined undefined (_display, line 78)
[Log] sortEnd undefined undefined (_display, line 78)
[Log] filterStart undefined undefined (_display, line 78)
[Log] filterEnd 20 20 (_display, line 78)

@Mottie

This comment has been minimized.

Show comment
Hide comment
@Mottie

Mottie Jul 15, 2014

Owner

But but...
spam-jam-5

Owner

Mottie commented Jul 15, 2014

But but...
spam-jam-5

@TheSin-

This comment has been minimized.

Show comment
Hide comment
@TheSin-

TheSin- Jul 15, 2014

Collaborator

really??

spam_73

shouldn't have closed it till it was fixed then!! :D

Collaborator

TheSin- commented Jul 15, 2014

really??

spam_73

shouldn't have closed it till it was fixed then!! :D

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