How to set page after server side processing done??
How to set page after server side processing done??
Hi guys.
first, sorry about poor english.
I going to die because don't know how to set page after load data by server proccessing.
In my case, I don't know that wanted row's number..
So I can't set displayStart parameter.. (Big Problem!!!)
After php processing, I know wanted row's count number... (ex: wanted row count = 292)
if wanted row's count number 292, I want set datatables page number 29 and active second row. ( <- point!!)
I can active second row, but how set page 29 after ajax call..??
please be my teacher of this problem.
thanks!
805 var datatable = $('#event_datatable').DataTable({ 806 responsive: true, 807 searching: false, 808 ordering: false, 809 processing: true, 810 serverSide: true, 811 scrollY: 250, 812 ajax: { 813 url: '/ajax/event/agent_event/', 814 type: 'POST', 815 data: { 816 devseq: devseq, 817 metrics: metrics, 818 histseq: histseq, 819 page: function(){ 820 return $('#event_datatable').DataTable().page.info().page; 821 }, 822 } 823 }, 824 drawCallback: function(result){ 825 if(result.json.recordsTotal == 0){ 826 $('#event_datatable').off('click','tbody tr'); 827 }else if('row' in result.json){ 828 $('#event_datatable tbody tr').eq(result.json.row).click(); // active row 829 } 830 } 831 });