1

For big tables I use jquery data tables. For example The pagination is on page 4 and with a reload of the site (because of a sent form) the pagination jumps automatically to the first pagination site.

Is there a possibility to avoid this behaviour?

3 Answers 3

1

Use the stateSave option. Basic usage (dataTables 1.10.x) :

var table = $('#example').DataTable({
    stateSave: true
});

demo -> http://jsfiddle.net/cayb99cq/

Select a page, then right click in the frame where the datatable is (the lower right frame) and select "reload frame".

Sign up to request clarification or add additional context in comments.

Comments

0

You can post the pagination value (ie page number or limit an offset) with the form itself and retrieve data for the data table for that pagination value.

OR

Submit form using AJAX (ie dynamic) and reload only that div

3 Comments

How do I get the pagination number from jquery datatables?
I solved this topic by reading the API carefully. The option "bStateSave": true keeps the current pagination number
Post offset with form submit and while reterving data from db use the posted offset as offset, limit
0

Alternatively if your doign a draw or invalidate jsut pass false and the pagination will remain IE:

table.cell( this ).invalidate().draw(false);

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.