4

I am planning to use Jquery DataTable to display user inbox. I want to load the user messages partially when he clicks on the page number or next or prev button.

from my initial research i think that jquery DataTable needs all table data before it is rendered.

Does any one knows whether there is any possible way to load data tables on user request ?

2 Answers 2

6

No, you can easily add data to DataTable, just take a look at documentation :

http://datatables.net/api#fnAddData

Or http://datatables.net/release-datatables/examples/server_side/server_side.html

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

2 Comments

thanks, but is it possible to send custom data to the ajax source ?
Ok, I found how to send custom variables for ajaxsource datatables.net/examples/server_side/custom_vars.html
1

You can re-initialize data on Datatable dynamically like.

// clear all Datatable instance object 
$('#sample').DataTable().clear();

// re-initialize array values using foreach
sample_array = ['car','apple']
$.each(sample_array, function( index, value ) {
      $('#sample').dataTable().fnAddData( [value]);
});

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.