How do i have to define JSON on server to be able to inicialice mRender like a function for example ?
When we define a boolean,
$json["tabla"]["aoColumns"][0]["bSortable"] = true;
with a integer
$json["tabla"]["aoColumns"][0]["value"] = 1;
with a string
$json["tabla"]["aoColumns"][0]["sTitle"] = "string";
But when we need to define a function, how do we do it ?
$json["tabla"]["aoColumns"][0]["mRender"] = ?????????;
$(document).ready(function() {
function initTabla( json )
{
oTable = $('#example').dataTable({
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "http://gestionmimascota.loc/categorias/listar",
"sServerMethod": "POST",
"aaData": json.tabla.aaData,
"aoColumns": json.tabla.aoColumns,
...
}
$.ajax() {
"dataType": 'json',
"type": "POST",
"url": "http://gestionmimascota.loc/categorias/iniciarTabla",
"success": initTabla
} );
}
PD: mRender need to be inicialiced on server side because it could change, aoColumns are dynamic.
Anyone know ? I think i saw a solution for this problem but i dont find it now. :S
In advance ty vm.
When we define a boolean,
$json["tabla"]["aoColumns"][0]["bSortable"] = true;
with a integer
$json["tabla"]["aoColumns"][0]["value"] = 1;
with a string
$json["tabla"]["aoColumns"][0]["sTitle"] = "string";
But when we need to define a function, how do we do it ?
$json["tabla"]["aoColumns"][0]["mRender"] = ?????????;
$(document).ready(function() {
function initTabla( json )
{
oTable = $('#example').dataTable({
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "http://gestionmimascota.loc/categorias/listar",
"sServerMethod": "POST",
"aaData": json.tabla.aaData,
"aoColumns": json.tabla.aoColumns,
...
}
$.ajax() {
"dataType": 'json',
"type": "POST",
"url": "http://gestionmimascota.loc/categorias/iniciarTabla",
"success": initTabla
} );
}
PD: mRender need to be inicialiced on server side because it could change, aoColumns are dynamic.
Anyone know ? I think i saw a solution for this problem but i dont find it now. :S
In advance ty vm.