Set the total records value in fnPreDrawCallback

Set the total records value in fnPreDrawCallback

DoltscheDoltsche Posts: 9Questions: 0Answers: 0
edited May 2013 in DataTables 1.9
Dear community.

In order to combine the features of DataTables with the features of ASP.NET WebForms, there seem to be some tricks needed. Especially if you'd like to use server-side processing. Because DataTables server-side processing is completely handled with JavaScript, I can't use any features of ASP.NET WebForms. So, I do the server-side processing indirectly by using the ASP Repeater to render a dynamic table inside an UpdatePanel and then reapply the DataTables on the new generated table. This works quite well and I can pass the DataTables specific attributes to the server by the use of HiddenFields.

However, I need to set some of the DataTables properties manually, after the UpdatePanel has finished its work. What I'm actually trying to do is to set the amount of total records of the DataTables in the "fnPreDrawCallback". At this time, the number of total records is stored in a hidden field which I can then access by jQuery. Unfortunately, I didn't found any propertie or function of DataTables which allows me to do that. I hope you can help me further.

My question in short is as the following:

[code]
"fnPreDrawCallback": function (oSettings) {
var iTotalRecords = $('#HiddenField_iTotal').val();
/* How can I pass the iTotalRecords value to DataTables for paging purpose? */
}
[/code]

I'm looking forward for your answer.

Best regards,

Samuel
This discussion has been closed.