jQuery datatable append th before it initialize
jQuery datatable append th before it initialize
I am using below code to fill it.
[code]
$(document).ready(function() {
$('#FormsData').dataTable({
"sDom": 'T<"clear">lfrtip',
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "GetJsonData.aspx?FormKey=" + getQuerystring("FormKey", "") + "&FormData=Get"
)}
)}
[/code]
Now problem is that in this way I have to define th in table structure . But in my case I want to append th dynamically to the table before it initialize.
I want to append th based on json data which I get from GetJsonData.aspx file. Its defined in "sAjaxSource": "GetJsonData.aspx ..."
[code]
$(document).ready(function() {
$('#FormsData').dataTable({
"sDom": 'T<"clear">lfrtip',
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "GetJsonData.aspx?FormKey=" + getQuerystring("FormKey", "") + "&FormData=Get"
)}
)}
[/code]
Now problem is that in this way I have to define th in table structure . But in my case I want to append th dynamically to the table before it initialize.
I want to append th based on json data which I get from GetJsonData.aspx file. Its defined in "sAjaxSource": "GetJsonData.aspx ..."
This discussion has been closed.