I am trying to add the dynamic column header to data table ,Here is my code for datatable initialisation:
var $table=$('#MSRRes').dataTable
( {
"bFilter": false,
"bDestroy": true,
"bJQueryUI": true,
"ajax" :{
url: 'getResult.php',
type: "POST",
data: {
formData:postData,
formName:'afscpMsr',
action:'advanceSrch'
}
}
});
Following code is for static intialisation of table column header :
Customer Name
Feature Order No
NCP Account Number
Mcn Code
Sales Person
Due Date
(DD/MM/YYYY)
No. of SUPs
Zonee Id
Details
The following code is ajax call to get the datatable result display along with the column names to be display: $result is in json format,$colcond='cust_name,cust_no,mcn_no,sales_contact_name,order_no,COUNT(sup_id),due_date,z.zoned_from_id';
$newarray = array(
"draw" => 1,
"recordsTotal" => sizeof($result),
"recordsFiltered" => sizeof($result),
"data" => $result,
"column" => $colCond
);
echo json_encode($newarray);
jquery-ui, hence removing the tag. Correct me if I'm wrong.