php - orderBy in Laravel + jquery datatables -
in database, here have
i've tried query , order price
$service_plans = db::table('service_plans') ->orderby('price', 'asc') ->get();
i kept getting
did miss or did i'm not suppose here ?
any hints ?
p.s. keep in mind i'm using jquery datatables
since you're using datatables jquery plug-in, remove orderby
in controller query.
instead, sort via datatables (which default):
$('#datatable').datatable({ "order": [[ 2, "asc" ]] // order on init. # column, starting @ 0 });
there's nice little laravel package datatables set data. check , see if it'd useful: https://github.com/yajra/laravel-datatables
Comments
Post a Comment