Ability to override _fnAjaxUpdateDraw?
Ability to override _fnAjaxUpdateDraw?
lastbyte
Posts: 8Questions: 0Answers: 0
I'm using server side data, but .net likes to return the data under the "d" property (ie, {d: {recordsTotal: 30, data: [...]}}). I see that I can use the 'dataSrc' property to specify how to get the data, but is there something similar for the other properties (recordsTotal, recordsFiltered, draw)?
I see that really nice _fnAjaxUpdateDraw function in the code. Is there any way that I can override it?
I see that really nice _fnAjaxUpdateDraw function in the code. Is there any way that I can override it?
This discussion has been closed.
Replies
Allan
[code]
var tableOpts = {
ajax: {
url: 'Blah.aspx/GetData',
data: function (d) {
return $.toJSON({
id: 3,
draw: d.draw,
order: d.order
});
},
converters: {
"json net": function(msg) {
return msg.hasOwnProperty('d') ? msg.d : msg;
}
},
type: 'POST',
contentType: 'application/json; charset=utf-8',
dataType: 'json net'
},
serverSide: true,
processing: true
};
var table = $('#report').dataTable(tableOpts)
[/code]