php - orderBy in Laravel + jquery datatables -


in database, here have

enter image description here

i've tried query , order price

$service_plans = db::table('service_plans') ->orderby('price', 'asc') ->get(); 

i kept getting

enter image description here

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

Popular posts from this blog

javascript - Slick Slider width recalculation -

jsf - PrimeFaces Datatable - What is f:facet actually doing? -

angular2 services - Angular 2 RC 4 Http post not firing -