Getting new data using Pipeline
Getting new data using Pipeline
Hi,
I love this plugin but i'm having a hard time figuring out how to do what I want to do. Hoping you can help.
I'll be loading a "master" set of skeleton records. Basically, say, 5000. They'll come from my database. I'll only display up to 100 records per page. When i display those 100 records I'll be loading full details for them (not just the master thinned out data).
So... what I want to do is load the master data for paging and then as I page, load 'that' page's full details.
I found this link below but I"m not sure exactly how to go about it.
http://datatables.net/examples/server_side/pipeline.html
I'm using ajax calls to my c# WebMethod. My ajax call looks something like this:
[code]
var divToBeWorkedOn = '#AjaxPlaceHolder';
var webMethod = 'Web.asmx/GetInfoByDates'
var parameters = "{'sDate':'" + sDate + "','eDate':'" + eDate + "'}"
$.ajax({
type: "POST",
url: webMethod,
data: parameters,
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(msg) {
$(divToBeWorkedOn).html(msg.d);
},
error: function(e){
$(divToBeWorkedOn).html("Unavailable");
}
});
[/code]
thanks for any help!
Craig
I love this plugin but i'm having a hard time figuring out how to do what I want to do. Hoping you can help.
I'll be loading a "master" set of skeleton records. Basically, say, 5000. They'll come from my database. I'll only display up to 100 records per page. When i display those 100 records I'll be loading full details for them (not just the master thinned out data).
So... what I want to do is load the master data for paging and then as I page, load 'that' page's full details.
I found this link below but I"m not sure exactly how to go about it.
http://datatables.net/examples/server_side/pipeline.html
I'm using ajax calls to my c# WebMethod. My ajax call looks something like this:
[code]
var divToBeWorkedOn = '#AjaxPlaceHolder';
var webMethod = 'Web.asmx/GetInfoByDates'
var parameters = "{'sDate':'" + sDate + "','eDate':'" + eDate + "'}"
$.ajax({
type: "POST",
url: webMethod,
data: parameters,
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(msg) {
$(divToBeWorkedOn).html(msg.d);
},
error: function(e){
$(divToBeWorkedOn).html("Unavailable");
}
});
[/code]
thanks for any help!
Craig
This discussion has been closed.
Replies
A couple of things worth noting about this approach - you won't be able to use the filtering on the details (since DataTables doesn't have the full data set - if you wanted that then server-side processing might be a suitable option). Also, without some clever caching, it would do the data loading thing on every draw - even for rows that it has already got.
Another approach - which is probably a bit more difficult to implement would be to use the pipelining example you linked to, and have that in the background go and get the detailed data, and just gradually build up the full set (almost a deferred loading).
Allan