Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Table instance gets stuck when switching routes and a reactive filter is in place. #38

Open
jasonxeno opened this issue Jun 7, 2014 · 4 comments
Labels

Comments

@jasonxeno
Copy link

I'm having a problem where if you have a reactive filter set, and you go to another page, and then come back, the available rows get messed up, and some rows become non accessible.

Here is how to recreate the issue:

  1. Go to:
    http://jquery-datatables.meteor.com/

Take note that the bottom of the table says "Showing 1 to 10 of 101,266 entries"

  1. Check the checkbox "created today" and wait for the table to process.
  2. Go to another page (Click Examples -> Data Sources.)
  3. Click page Examples -> Reactive Query.
  4. The table at the bottom says "Showing 1 to 10 of 77 entries" and "created today" is not checked.
  5. At this point the table is broken, and it seems there is no way to get back to the original 100,000 rows. Checking and unchecking "created today" does not fix it, nor does fooling around with the other filters.

I've tried all sorts of things like resetting session variables in my own app that I using jquery-datatables with, I think there may be a problem with the subscription that the package controls getting stuck when a filter is set and the route changes. So when you come back it is stuck somehow.

Any ideas?

This is an amazing package by the way, thank you!

@jasonxeno
Copy link
Author

I'm not sure if it helps, but I tried using all these functions to reset the table, and they were not able to reset it back to normal:

$('#shipments_table table').dataTable().fnClearTable()
$('#shipments_table table').dataTable().fnDraw()
$('#shipments_table table').dataTable().fnUpdate()
$('#shipments_table table').dataTable().fnDestroy()
$('#shipments_table table').dataTable().destroy()
$('#shipments_table table').dataTable().empty()
$('#shipments_table table').dataTable().ajax.reload()

@gjolund gjolund added the bug label Jun 8, 2014
@gjolund
Copy link
Contributor

gjolund commented Jun 8, 2014

Hey @jcswanson

Thanks for taking the time to document what you already tried. Saves me some time!

I plan on addressing a few issues this week having to do with saving table / subscription state between pages, and I believe this issue will be resolved along with them.

Have you noticed any other weird bugs or quirks?

@jasonxeno
Copy link
Author

Great! Thank you @austinrivas for your hard work on this package.

Here is another bug that may also be related but does not involve page switching:

  1. Go to http://jquery-datatables.meteor.com/
  2. Activate any of the reactive filters, for example check 'Created Today'
  3. On the upper right hand corner of the table click the show dropdown and pick another value, for example '25'
  4. Change any of the filters, the table will not respond to the reactive filters any more, it will be stuck to the original filters as they were before changing the show value.

@jasonxeno
Copy link
Author

I thought perhaps the latest meteor release candidate might fix this issue for example:
"Fix a Blaze memory leak by cleaning up event handlers when a template instance is destroyed. #1997"
https://github.com/meteor/meteor/blob/release-0.8.2/History.md

But the issue still happens.

Any idea on what may be happening with the error @austinrivas ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants