Reading extra data which is passed to datatable json string
Reading extra data which is passed to datatable json string
matthewj
Posts: 39Questions: 2Answers: 0
Hi Allan,
I am passing some extra info in datatable's json string but would you please let me know how we read that extra data. for eg I have below json string to display datatable and I am passing an extra info in the end - "completedcnt":"6"
[code]
{
"aaData":
[
{"id":1197888,"start_date":"10/12/12","due_date":"10/12/13","expire_date":"10/12/13","status":"Incomplete","overdue":false},
{"id":1198757,"start_date":"10/16/12","due_date":"10/16/13","expire_date":"10/16/13","status":"Incomplete","overdue":false}
],
"completedcnt":"6"
}
[/code]
Regards,
Mathew
I am passing some extra info in datatable's json string but would you please let me know how we read that extra data. for eg I have below json string to display datatable and I am passing an extra info in the end - "completedcnt":"6"
[code]
{
"aaData":
[
{"id":1197888,"start_date":"10/12/12","due_date":"10/12/13","expire_date":"10/12/13","status":"Incomplete","overdue":false},
{"id":1198757,"start_date":"10/16/12","due_date":"10/16/13","expire_date":"10/16/13","status":"Incomplete","overdue":false}
],
"completedcnt":"6"
}
[/code]
Regards,
Mathew
This discussion has been closed.
Replies
1. Use fnServerData and intercept the JSON before or after you callback the DataTables draw function
2. Use the xhr event - http://datatables.net/docs/DataTables/1.9.4/DataTable.html#xhr
3. Use fnInitComplete which will give you the JSON as the second parameter.
Allan