Skip to content
This repository has been archived by the owner on Apr 17, 2019. It is now read-only.

order default by custom field? #33

Closed
carlituxman opened this issue Feb 19, 2014 · 1 comment
Closed

order default by custom field? #33

carlituxman opened this issue Feb 19, 2014 · 1 comment

Comments

@carlituxman
Copy link

I have at server side

return Datatable::collection(Mymodel::orderBy('type')->get())
->showColumns('id','type','order','title','about')
->searchColumns('title','about')
->orderColumns('type','order','title')
->addColumn('type',function($model)
{
return Mymodel::Typename($model->type); //show the name of type number
})->make()

I want the first ordering default be 'type', but if y show 'type' like a custom field the order (in this example), the order default is by 'id', in fact, if I debug, the getOrder() return
["id","type","order","title","about"]

How can I establish a default order ?

@carlituxman
Copy link
Author

sorry was a my bug!!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant