ServerSide Processing - But no interaction with DB
ServerSide Processing - But no interaction with DB
meetshriram
Posts: 5Questions: 0Answers: 0
Hi, first of all many thanks for this beautiful plug-in and offering it for free.
I've been facing a problem and unable to implement the code for it. I'm using this plug-in in my jsp and the scenario is like this...
My application is fetching all the records (1000+) from DB. This is quite fast. But I do some manipulations to the fetched data. After this manipulations I render it on the screen. Here is taking a lot of time to render 1000+ records. So I opted to use pagination which is offered by this plug-in. But this plug-in is getting applied once all the rendering happens. So decided to use server side processing. I just would like to use this server side processing to hit the same page again and again so that I can fetch only few records (my data will be present in session), manipulate it and render it on the page.
Somehow I'm failed to write logic for this. What I've implemented so far is...
[code]
("#resTab").dataTable({
bLengthChange : false,
sPaginationType : "full_numbers",
bProcessing : true,
bServerSide : true,
sAjaxSource : "data.jsp",
sServerMethod : "POST",
iTotalRecords : '<%= resultCount %>', /* As I know the total numbers of records, I'll be assigning it here*/
iTotalDisplayRecords : 100 /* Only 100 records per page*/
});
[/code]
Please refine this and recommend how to implement it.
Thanks in Advance,
Sriram
I've been facing a problem and unable to implement the code for it. I'm using this plug-in in my jsp and the scenario is like this...
My application is fetching all the records (1000+) from DB. This is quite fast. But I do some manipulations to the fetched data. After this manipulations I render it on the screen. Here is taking a lot of time to render 1000+ records. So I opted to use pagination which is offered by this plug-in. But this plug-in is getting applied once all the rendering happens. So decided to use server side processing. I just would like to use this server side processing to hit the same page again and again so that I can fetch only few records (my data will be present in session), manipulate it and render it on the page.
Somehow I'm failed to write logic for this. What I've implemented so far is...
[code]
("#resTab").dataTable({
bLengthChange : false,
sPaginationType : "full_numbers",
bProcessing : true,
bServerSide : true,
sAjaxSource : "data.jsp",
sServerMethod : "POST",
iTotalRecords : '<%= resultCount %>', /* As I know the total numbers of records, I'll be assigning it here*/
iTotalDisplayRecords : 100 /* Only 100 records per page*/
});
[/code]
Please refine this and recommend how to implement it.
Thanks in Advance,
Sriram
This discussion has been closed.
Replies
Allan
Did you find any solution. because i having the same problem. need to implement paging :(
If you want to use server-side processing, then yes it does require it. The documentation page details the exact format that must be returned from the server.
Allan
Allan