bgultekin / laravel4-datatables-package

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

Chinese chracter cannot search #46

Closed Partoo closed 11 years ago

Partoo commented 11 years ago

Thanks for your work, but I find that can not search use Chinese character, of course, this maybe associated with laravel, you have any suggestions?

Partoo commented 11 years ago

I try to change $keyword = '%'.Input::get('sSearch').'%'; to $keyword = '%'.urlencode(Input::get('sSearch')).'%';

No errors report,but can't find anything...

Partoo commented 11 years ago

I found the way: https://github.com/bllim/laravel-datatables-bundle/issues/4

use "aoColumns": [ { "bSearchable": true }, null, null, {"bSearchable":false}, {"bSearchable":false}, {"bSearchable":false} ], disable timestamp field.

summerblue commented 10 years ago

For who is reading this :

var oTable;
$(document).ready(function() {
    oTable = $('#features').dataTable( {
        "sDom": "<'row'<'col-md-6'l><'col-md-6'f>r>t<'row'<'col-md-6'i><'col-md-6'p>>",
        "sPaginationType": "bootstrap",
        "oLanguage": {
            "sLengthMenu": "_MENU_ 每页显示数量"
        },

        // this is for search column, specify witch is searchable
        // in my case I have four colum: id, title, description, created_at
        "aoColumns": [
            {"bSearchable": false },
            {"bSearchable": true },
            {"bSearchable": true },
            {"bSearchable":false},
        ],

        "bProcessing": true,
        "bServerSide": true,
        "sAjaxSource": "{{ URL::to('admin/features/data') }}",
        "fnDrawCallback": function ( oSettings ) {
            $(".iframe").colorbox({iframe:true, width:"80%", height:"80%"});
        }
    });
});