-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Open
Labels
type:featureNew feature or improvement of existing featureNew feature or improvement of existing feature
Description
New Feature / Enhancement Checklist
- I am not disclosing a vulnerability.I am not just asking a question.I have searched through existing issues.To pick up a draggable item, press the space bar. While dragging, use the arrow keys to move the item. Press space again to drop the item in its new position, or press escape to cancel.
Current Limitation
With many columns we often want to see ex username and email before other less relevant fields. Currently the four system columns appear first and then the rest of the fields have a random? order.
Feature / Enhancement Description
Forcing the columns to be in the same order that is specified in the columnPreference
field. All non-mentioned columns can come in a random order in the end.
apps: [
{
columnPreference: {
"_User": [
{ name: "objectId" } // first column
{ name: "username" } // second column
]
}
},
],
Example Use Case
All dashboard users store their own ordering in localStorage, but I don't want everyone to need to create their own order for 10ths of classes. It would be good to provide a sensible and customised default for all users.
Alternatives / Workarounds
None which I am aware of.
3rd Party References
Yohannfra
Metadata
Metadata
Assignees
Labels
type:featureNew feature or improvement of existing featureNew feature or improvement of existing feature
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
parse-github-assistant commentedon Oct 2, 2023
Thanks for opening this issue!
theolundqvist commentedon Oct 2, 2023
Addition:
I would also want to be able to provide a default ordering for the classes. Maybe even separate them into groups with a horizontal line such as it is done with the system classes.
mtrezza commentedon Oct 2, 2023
The auto-sort sorts the rest of the fields alphabetically, not randomly, that's what it's supposed to do anyway.
Did you check whether
columnPreference
already supports predefined column sorting? It may not be documented in the README but the feature may exist in code.theolundqvist commentedon Oct 3, 2023
I did do some digging but I could try again.
This is what the columns in one of my classes look like in a fresh browser

The first four fields are always in the same order and the custom fields does not seem to be in alphabetical order.
Doing this does not affect the order.
It seems to me that this should work based on the code here: ColumnPreference.js:100
First it adds the columns in localstorage, then objectId, then the defaultPrefs and lastly all the others in a convenient order since there is no sorting going on from what I can tell.
Actually..., Safari was probably not as clean as I thought. I opened they dashboard in a new icognito window and this is the result:

So it does work.
But there is still a minor problem here. Even if I never added any clientside custom ordering to the Progress class the dashboard saves the order in my localstorage and applies it with priority the next time I open the dashboard. Meaning that server side ordering changes won't affect the client if they ever opened the dashboard before.