¿Es posible cambiar el valor de configuración de jQuery DataTables en tiempo real? Mi problema es el siguiente, necesito cambiar sAjaxSource
al vuelo. Ya hemos probado algo como esto:¿Cambiar el valor de configuración sobre la marcha?
var oDefault = {
"bServerSide": true,
"bProcessing": true,
"bJQueryUI": true,
"bLengthChange": false,
"bFilter": true,
"iDisplayLength": 8,
"sAjaxSource": "my.php?" + "idKat="+aData[3],
"aaSorting": [[ 0, "asc" ],[ 3, "asc" ]],
"sDom": '<"top"ir>t<"bottom"pf<"clear">',
"sPaginationType": "full_numbers",
"oLanguage": {
"sUrl": "<?php echo $full_path_jezik_2;?>"
},
"aoColumns": [
{ "sName": "rb","sWidth": "15%", "sClass": "center","sType": "numeric" },
{ "sName": "chkZaBrisanje","sWidth": "20%", "sClass": "center", "bSortable":false },
{ "sName": "rbPrvaSlika","sWidth": "15%", "sClass": "center","bSortable":false },
{ "sName": "nazivSlike","sWidth": "50%", "sClass": "center", "sSortDataType": "dom-text" }
]
};
var oST = $.extend(true, {}, oDefault);
oST.sAjaxSource = "my.php?" + "idKat="+aData[3];
alert(oST.sAjaxSource);
if (typeof oTable == 'undefined') {
oTable = $("#my-table").dataTable(oST);
}
else
{
oTable.fnDraw();
}
Mi aData[3]
se cambia al hacer clic.
tnx hombre, esto funciona, muchas gracias. – user147
No funciona para mí, al menos no con 'bProcessing'. –
No importa, es fnSettings(). OFeatures.bProcessing, pero parece fubar si se establece en false durante init. –