-
Notifications
You must be signed in to change notification settings - Fork 754
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
Issues with Pager AJAX and Filtering. #456
Comments
Hi @Lynesth! You have excellent English skills :) Both of the issues you mention above do sound like problems with the code. I will put them on my to-do list. |
Hello @Mottie ! Thank you for the English skills comment :) Here is what I changed in jquery.tablesorter.pager.js to take care of the first "issue" : 274 d = p.totalRows == 0 ? " " : result[t ? 0 : 1] || []; // row data Though you could also be a bit more precise and write down something like "No match found." like you do when you catch an exception. I'm not that good with JS either so that might be just a little workaround but at least, it works for me :p |
Hi @Lynesth! Thanks for sharing your code changes! I was thinking that for the second issue, should the page always be set to the first? Currently, it should stay on the current page if the current page is not less than the filtered pages, and go to the last page if the current page is greater. If that isn't working as it should, I don't see a problem with setting the page back to the first. Should this be an option, or do you think there would ever be a case that someone would not want to go back to the first page? |
Hmmm... I don't see a reason I would not go back to first page on filter. |
+1 to going back to first page after filtering. Could make it optional but On Wed, Dec 11, 2013 at 5:51 PM, Rob G [email protected] wrote:
|
when you filter a dataset.. the amount of items/pages would change. thus the current item/page counts should be re-calculated.. and yes back to the first page. |
Ok, both of these issues will be fixed in the next update. |
Cool thing thank you ;) |
Hello,
I haven't seen this issue posted before so I hope I didn't miss it. And excuse my poor english as it isn't my mothertongue (feel free to ask anything I may have not explained well enough).
Here is what's happening :
I had to change the ajaxProcessing function to check if the total number of rows returned is more than 0, otherwise return [ 0, " " ];
I think you'll better understand with this :
Couldn't it be a simple feature of the plugin ? Or am I really stupid and missing something ?
On another note, I was having issues when I was on the last page of a table and then filter it. Since I was getting much less total_rows (so much less pages) but the {page} sent to the PHP script was still the same and therefore it was unable to return any rows.
So is this the rigth way to make sure that the pager will be returning to the first page everytime the table gets filtered (still talking about ajax here) ?
I'm really not sure I made myself clear enough, but I hope so.
thank you for this awesome fork of tablesorter which is very handy 👍 !
Lyn.
The text was updated successfully, but these errors were encountered: