• Resolved franckamizet

    (@franckamizet)


    Hi there !

    First point : I’ve got a JS function on my page which detects the scrollTop position : OK

    What I want to perform : fire the “loading filter params dataset” function when my scrollTop is a specific number in order to automatically load posts by scrolling down to a specific position from the bottom page (like some other page examples with automatic ajax content loader feature)

    Which “loading filter params dataset” function could I use and fire with my trigger please ? and how to send these Filter params dataset in order to load the next ajax content ?

    Is there any other solution to achieve this automatic loading ajax feature by scrolling down ?

    Thank you for your great plugin and your help !

    • This topic was modified 4 days, 20 hours ago by franckamizet.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author YMC

    (@wssoffice21)

    Hi!
    You should use the API JS plugin see documentation https://github.com/YMC-22/smart-filter#js-api-filter–grids.
    You should first stop loading posts using the hook
    wp.hooks.addAction(‘ymc_stop_loading_data’, ‘smartfilter’, ‘callback(elem)’);
    Then, after that, get the data of the filter params object using JSON.parse(). After that, pack the changes again using JSON.stringify() and then make a request using the API plugin method, for example, YMCTools({target: ‘.data-target-ymcFilterID-LayoutID’}).apiGetPosts();
    This whole algorithm involves making changes to the plugin settings with subsequent creation and launch of the request. We hope this will help you to implement your task.

    • This reply was modified 4 days, 18 hours ago by YMC.
    • This reply was modified 4 days, 18 hours ago by YMC.
    Thread Starter franckamizet

    (@franckamizet)

    Great ! Thanks a lot ! ??

    Plugin Author YMC

    (@wssoffice21)

    Good Luck!

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.