bgultekin / laravel4-datatables-package

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

Datatable only returns 10 rows #192

Open longestdrive opened 9 years ago

longestdrive commented 9 years ago

Hi I'm having problems with the package. I've updated to the latest version today.

My query only pulls off the first 10 rows of data. My datatable has bServerside set to false and I should get over 200 rows returned.

If I set datatable to bServiside to true I can paginate through the 200 rows as expected.

It's as if the package is limiting the records being returned, here's my set up:

$members = Websiteuser::select(
        'users.id',
        DB::raw("CONCAT_WS(' ' , users.first_name, users.last_name) as name"),
        'users.email',
        'users.valid_member',
        'users.activated',
        'users.site_editor',
        'users.disabled'
        );

// dd($members->toSql()); $members_datatable = Datatables::of($members)->make()

What am I doing wrong?

longestdrive commented 9 years ago

Tracked the issue down. I was previously using version 1.4.1, since then you have added defaults in the method processdata so that if IdisplayLength is not set you default to 10 - is there a reason for this? To overcome I set iDisplayLength in my jquery initialisation to 999999 to ensure full data set is received. - seems to defeat the object of zero configuration? - However this then corrupts as I then get a full data set in the datatable without pagination.

Will revert to 1.4.1 for now

Is there a reason for the change that I'm missing?

I'm using datatables 1.10 and Laravel 4.2

naude commented 9 years ago

I did a composer update today "laravel/framework": "~4.2.11", "bllim/datatables": "*", to get beanstalk going and then i noted all my ajax datatables only display 10 records and no longer honored my custom iDisplayLength: 50, even though the ajax Serverside returns 130 records (3 tabs with bootstrap pagination)

Tables that dont use ajax were sill working.

I then added this to the table blade "bServerSide": true and its working again.