I have a code in codeigniter, and i am using a data-table, now i want to make a show/hide columns with a checkbox above to let the columns hide or maybe shown. I will populate my data from my database in my controller with these code :
public function dataTable_report($date) {
$user = array('user_id' => $this->session->userdata['logged_in']['user_id']);
$myreport = $this->Adminreport_model->getreportDataDaily($user,$date);
$data = array();
foreach ($myreport as $patient) {
$row = array();
$row[] = $patient->check_up_id;
$row[] = $patient->patient_fname;
$row[] = $patient->patient_lname;
$row[] = $patient->patient_mname;
$row[] = $patient->check_up_date;
$row[] = $patient->clinic_name;
$row[] = $patient->bill_amt;
$data[] = $row;
}
$output = array(
"data" => $data,
);
echo json_encode($output);
}
now here is my data-table that doesn't hide when i check my checkbox above please help me: https://jsfiddle.net/2j6w9hqt/27/