Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

orderBy('sort') for permissions BP Latest #552

Closed
digitalit opened this issue Nov 12, 2016 · 3 comments
Closed

orderBy('sort') for permissions BP Latest #552

digitalit opened this issue Nov 12, 2016 · 3 comments
Assignees
Labels

Comments

@digitalit
Copy link

Don't know if I'm missing something but my permissions won't sort by sort so i changed
App\Repositories\Repository on line 16 from:

return $this->query()->get();

to

return $this->query()->orderBy('sort')->get();

Is this okay or is it a better way?

@blomdahldaniel
Copy link
Contributor

This is interesting, if your way solves then it does that for the sort column only. And your way will always sort after the sort and I would not make such a change in the Repository!

However, this seem to have brought up a bug. The DataTables Sort By does not work for the entire Roles table.

I tried to take a look at it but honestly I dont quite get how DataaTables are sorting things.
When I look in the laravel debug bar I can see that the correct queries are requested. However it is not reflected in the DataTables. Almost seems like something is wrong with the javascript?
I think it is best that @rappasoft take a look at this since he knows the implementation best.

@digitalit
Copy link
Author

digitalit commented Nov 15, 2016

Well i personally don't use DataTables cause i like to have my own filtering and stuff but this were important to me since it soon gets allot of permissions and i need them to list in an correct order.

Let's say i crate an new permission for projects i want it among the other project permissions and not at the end of the list.

My fix woks for me but please tell me if you decide to solve it in another way :)

Edit: Well now i see what you mean, the role list gets locked to permission sort. This is obvious not the idea. I just wanted to hard code permission sort by order in the sub list in roles DataTable.

I don't have many roles so this is not an problem for me but of course there must be an way to solve this?

@rappasoft
Copy link
Owner

Fixed in upcoming.

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

No branches or pull requests

3 participants