Personalización del lado del servidor en el complemento de tablas de datos
Frecuentes
Visto 233 veces
1
I have 10,000 records. I am using datatables and for back-end I am using php and mysql. The first time when I am trying to load my application, it is taking much time due to heavy records. So please tell me how to avoid this loading issue and for my time during loading only 20 records I want to load. My code is like :
$('#example').dataTable( {
"bProcessing": true,
"sAjaxSource": "datatable-businesslist.php",
"bJQueryUI": true,
"sPaginationType": "full_numbers",
"sDom": 'T<"clear">lfrtip',
"oLanguage": {
"sSearch": "Search all columns:"
},
"oTableTools": {
"aButtons": [
{
"sExtends": "csv",
"sButtonText": "Save to CSV",
"mColumns":[0,1,2,3,4,5,6,7,8],
"bFooter":false
}
},
"aoColumns": [
null,null,null,null,null,{ "bSortable": false },null,null,null,{ "bSortable": false }
]
} );
and in the datatable-businesslist.php page, I wrote down the simple server side code as I got from datatables.net site. So please help me how to avoid this issue.
1 Respuestas
0
Intente agregar esta línea:
"bServerSide": true,
Respondido 28 ago 12, 17:08
No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas php mysql datatable or haz tu propia pregunta.
But still problem is there.Its taking so much time. - Sundar
I have added the followings: "bDeferRender": true, "bSortClasses": false, "iDisplayLength": 10, "iDisplayStart" :0, and through the datatable-businesslist.php page when I am trying to fetch the records, I got 10 records only whereas if I run the original page, there its loading all 10,000 records for that time is taking. So what may be the solution? please help.... - Sundar
Also when I run datatable-businesslist.php page I got {"sEcho":0,"iTotalRecords":"3198","iTotalDisplayRecords":"3198","aaData":[]}. to write the code for datatable-businesslist.php page I follow datatables.net/desarrollo/lado-del-servidor/php_mysql . - Sundar