Forums › Forums › Search & Filter Pro › Issue With Table & Ajax rendering
- This topic has 5 replies, 2 voices, and was last updated 5 years, 1 month ago by
Trevor.
-
Anonymous(Private) March 13, 2020 at 2:13 pm #236655
Hi Trevor,
I’ve hit a bit of a dead end trying to set this up on my site.
On first load, the pagination of my Ninja Tables Pro plugin works correctly – but as soon as I use the Search & Filter Pro plugin to filter the results (via Ajax) the table loads a new rendering of the table and this seems to override the pagination that is set in Ninja Tables.
As you can see in the video below, I have the pagination set in Ninja Tables to 8.
If I change the “Results per page:” in S&FP to 8, it only loads 8 product and no more.
SCREENCAST OF ISSUE: https://screencast-o-matic.com/watch/cYeI21xUF5
Do you know why there seems to be a different rendering of the table upon filtering that is overriding the Ninja Table settings? If I turn Ajax off it loads the table correctly (ie. with pagination) every time, but I require Ajax annoyingly.
Very much stuck and any help or suggestions would be welcomed.
Thanks very much,
Anonymous(Private) March 13, 2020 at 6:12 pm #236687Thanks for the quick response.
Here’s the link to the live site as set up in the video.
http://skifonixsounds.com/sampleshare/copyright-free-music-home-page
I can also provide login info if needed.
Thanks !
Anonymous(Private) March 14, 2020 at 11:01 am #236698Hi Trevor,
So I’ve been given this script by Ninja Table and they’ve said the following…
Hello Lewis,
Understood your situation here, if you want to force the pagination, you need to run this script while after each filtering. It will enable the pagination again.
We are not familiar with the plugin you are using, you might have to get their help to run this script after each filtering.
jQuery(function($){ $('.table').footable({ "paging": { "enabled": true } }); });
Thanks
Would it be possible to direct me to how I could add this script to run this script after each filtering?
Thanks in advance,
Anonymous(Private) March 15, 2020 at 11:28 am #236714Managed to get it working with the below code put in the footer…
<script>(function ( $ ) { "use strict"; $(document).on("sf:ajaxfinish", ".searchandfilter", function(){ $('.table').footable({ "paging": { "enabled": true } }); }); }(jQuery));</script>
Just posting for others who might find useful.
Will close topic, cheers guys!
-
AuthorPosts