function view_user()
{
$status=1;
$this->datatables
->select("id,name,email,username,type,date_added")
->from('ap_users')
->unset_column('id')
->edit_column('type', '$1', 'callback_str_replace(1, ,type)')
->edit_column('date_added', '$1', 'callback_datechange(d-m-Y H:i|date_added)')
->add_column('edit', '<a href="profiles/edit/$1">edit</a> | <a href="profiles/edit/$1">delete</a>', 'id');
echo $this->datatables->generate();
}
The callback function not working it print full function in column.
javascript call
$('table.all').dataTable({
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": config.base_url + "main/view_user",
'fnServerData': function(sSource, aoData, fnCallback)
{
$.ajax
({
'dataType': 'json',
'type' : 'POST',
'url' : sSource,
'data' : aoData,
'success' : fnCallback
});
}
});
Also can anyone help me where to write the callback function
Click thumbnail to see full-size image