bgultekin / laravel4-datatables-package

Server-side handler of DataTables Jquery Plugin for Laravel 4
267 stars 108 forks source link

Problems when selecting many records in the database #103

Closed Soufraz closed 10 years ago

Soufraz commented 10 years ago

I'm making a query with eloquent you are selecting more than 2000 records in the database. And the datatables are not selecting for parts. For example, the number of records coming from the database, was to select the first 10 records, when I click on page 2 select next 10 and so on. Is there some specific configuration of the package? Am I doing something wrong?

  $('#datatable').dataTable({
    "processing": true,
    "serverSide": true,   
    "ajax": "{{ URL::asset('find-events') }}"
  }); 
Soufraz commented 10 years ago

I got!! Follow correctness of code:

$('#datatable').dataTable({
    "bProcessing": true,
    "bServerSide": true, 
    "sAjaxSource": "{{ URL::asset('find-events') }}"
  }); 
TeddyBear06 commented 10 years ago

Thank you Soufraz !

ktunkiewicz commented 10 years ago

"ajax" property is for Datatables v10.0+, using "sAjaxSource" switched DT into legacy mode so this is why it helped. New v.1.4.0 version of laravel4-datatables-package has just arrived, it is now fully compatible with DT 10.0+ so this issue is now outdated.