How can I get the jQuery plugin to update the loaded data?

I am working with jQuery Pagination and popup form. By storing the data in the form, how do I get the Pagination plugin to reload the data it will load for whatever page I'm on without reloading the entire web page?

Example: Point 1 Point 2 Point 3

Add Item-> Item 23-> Save-> Restart List

Clause 1 Clause 2 Clause 3 Clause 23

http://d-scribe.de/webtools/jquery-pagination/lib/jquery_pagination/README

http://plugins.jquery.com/project/pagination

+2


a source to share


2 answers


The only thing I could think of doing in this situation (and I'm not sure if this will work) is to call the page initialization function again. So you have to add a new element and then call it again,

function addNewElement() {
    $.create('div', {}).appendTo("container");
    $("#container").pagination(numElements, {
        items_per_page:20, 
        callback:handlePaginationClick
    });
}

      

Now, I've never used this plugin before, but I don't think there is any other way to "reload" the content as the plugin doesn't give you this option. Also, hopefully this overwrites the first call you made and doesn't add it to the first call.



I've used domec plugin here with $ .create. Just know that this is where you create your new element.

Hope it helps!
Metropolis

+1


a source


I looked, but I couldn't find the source for the plugin. I assume that you will need to add an update function for the plugin, which will update the data it uses. Also, you will need to unload and reload it.



0


a source







All Articles