Git Product home page Git Product logo

Comments (6)

luis-almeida avatar luis-almeida commented on July 17, 2024

Hi,

Thanks :)
This plugin offers only client side pagination, at least for now, maybe I'll add Ajax support in future releases.
I believe you're trying to paginate all the records in your DB but you can only apply the plugin to items that are already loaded in the page, so it won't work.

But you can always re-apply the plugin after an Ajax call. Is that what you're trying to do?

from jpages.

devmondo avatar devmondo commented on July 17, 2024

man,
thanks alot for the answer,
the problem is as you have said i am trying to paginate the database, and as you said the plugin will only paginate on client side, but what i want is to speed up things and only return 10 items per page, the only thing missing is to make the plugin able to inject number of pages based on total number of database records so each time you click on a page number a new request happens and you see the next batch of returned items.

from jpages.

luis-almeida avatar luis-almeida commented on July 17, 2024

Hi,

You're right! It's something I want to add in the future since it would make the plugin much more flexible.
But for now it's not possible since it's only a client side pagination plugin.
Stay tuned for future releases cos when I have some time I'll add Ajax requests.

from jpages.

devmondo avatar devmondo commented on July 17, 2024

thanks alot man,
i cant wait really, i want to replace all the stupid once i have tried and replaced with this beauty.

all the best on your endeavor :)

from jpages.

Nilegfx avatar Nilegfx commented on July 17, 2024

I'm facing the same problem here but i think the best solution is to "apply the plugin to items" as luis said. but surely we are waiting your Smart solution & Update.

from jpages.

Bratzilla avatar Bratzilla commented on July 17, 2024

I know this is an old thread, but I found a solution at least for how I'm using jPages.

In my case, I am simply using ajax to return a list of items (in other words, I'm pulling my items at once and just want to paginate the results). I dug around some jQuery documentation and found out about ajaxSuccess. The following code works for me, and perhaps it could be helpful to someone else.

jQuery(document).ajaxSuccess(function(event, request, settings) {
    jQuery(function($) {
        addScript($this->filePaths->js_plugins.'jPages.min.js') ?>
            $("div.holder").jPages({
                containerID: "searchlist"
            });
    });
})

Code is taken from my Joomla script (hence the 'addScript' call) but the basic principle is simple. Upon ajax success embed jPages and then invoke it. Hopefully someone can tweak this and make it better. I'm just happy that I can keep using jPages. :)

from jpages.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.