bgultekin / laravel4-datatables-package

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

Global search doesn't work if sorting is disabled #133

Closed nesl247 closed 10 years ago

nesl247 commented 10 years ago

Currently you are checking to see if a column is orderable in order to perform a global search. You should instead be checking to see if it is searchable.

On https://github.com/bllim/laravel4-datatables-package/blob/master/src/Bllim/Datatables/Datatables.php#L517

Change: if (isset($columns_copy[$i]) && $this->input['columns'][$i]['orderable'] == "true")

To: if (isset($columns_copy[$i]) && $this->input['columns'][$i]['searchable'] == "true")

mvolo commented 10 years ago

This fix worked for me.
Thanks nesl !

ktunkiewicz commented 10 years ago

Sorry for late reply, I was very busy this summer... You are right, I didn't notice that. This will be changed.