Append to my table, new data from server-side
Append to my table, new data from server-side
oal
Posts: 6Questions: 0Answers: 0
Hi !
Thanks for this plugin, it's totally Awesome !
My server is very slow ... And i can't change it.. So when i load the datatable, i must develop an functionalities for append more data to the table after clicking on a button..
i want something like this :
[code]
$('#display-more').click(function (e) {
// call Ajax and success(data)
oTable.fnAddData(data.aaData);
oSettings._iDisplayLength = 200; //Example
});
[/code]
The table already work server-side for clicking "next", "previous" etc...
But When i click to "Display-more" button.. That doesn't work..(If i add oTable.fnAddData(data.aaData); in fnInitComplete, data are added..)
And oTable.fnAddData() call fnServerData and i don't want to call it...
the principale function must append data to the table without clear the table or re-add data already add with the init when i load my page
have you an idea ?
Thanks
Thanks for this plugin, it's totally Awesome !
My server is very slow ... And i can't change it.. So when i load the datatable, i must develop an functionalities for append more data to the table after clicking on a button..
i want something like this :
[code]
$('#display-more').click(function (e) {
// call Ajax and success(data)
oTable.fnAddData(data.aaData);
oSettings._iDisplayLength = 200; //Example
});
[/code]
The table already work server-side for clicking "next", "previous" etc...
But When i click to "Display-more" button.. That doesn't work..(If i add oTable.fnAddData(data.aaData); in fnInitComplete, data are added..)
And oTable.fnAddData() call fnServerData and i don't want to call it...
the principale function must append data to the table without clear the table or re-add data already add with the init when i load my page
have you an idea ?
Thanks
This discussion has been closed.
Replies
If you have server-side processing enabled it will yes. That's the while point of server-side processing. Do you have sever-side processing enabled? I can't tell from the above - please post a test case: http://datatables.net/forums/discussion/12899/post-test-cases-when-asking-for-help-please-read
Allan
This example doesn't work... but it should be..
http://live.datatables.net/odetow/2/edit
In fact : my functionalities is the same when you click in dropbox for change the display-length but when you are server-side if during the load you display 100 rows and you change it for display 120 rows, you ask 120 rows instead of next 20 rows...
How can i do this ?
i would like to keep my 10 rows and add 10 another rows (so 10 next rows) with server-side and display this 20 rows.
another example :
i load 1000 rows and the user can choose to display 1010 rows. I would like to call my server-side for receive this 10 additional rows. By default, datatable ask 1010 rows
Can i change this ?
[quote]if you are using server-side processing (i.e. "bServerSide": true), then to add data, you must add it to the data source, i.e. the server-side, through an Ajax call.[/quote]
Do you have an example ?
If you are, then every page requires an Ajax get, that's how server-side processing works. You could use caching like in this example: http://datatables.net/release-datatables/examples/server_side/pipeline.html
Allan