-
Notifications
You must be signed in to change notification settings - Fork 381
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
feat: add column ids to datagrid #3031
Comments
Did you know that the DataGrid can already generate column headers by using the |
@vnbaaij i didn’t know that, but that only makes the need for this even stronger. |
I don't see why that makes the need stronger. In your API call etc. you can use the name that you have in your data/model for the property (i.e |
When you're using the GridItemsProvider, you get the title of the sort column (a.k.a. display name). To send to the server which property should be used for sorting, we would need to resolve the (localized) display name back to the property name. The |
Do you have a code example of how you are using that? I'm just trying to understand the issue. It seems odd that no one has run into this before. Also thinking how this would work for For solving it, you propose we add a property to |
🙋 Feature Request
I would the datagrid to not use the title for sorting. The title is a UI element, which might be translated. For sorting it would be useful to have a “stable” thing for the column
🤔 Expected Behavior
If I have a datagrid that is bound to a collection of users, with for instance a property GivenName, the column title might be “Given Name” or “Voornaam” or “nom d'oreille”
When querying the datasource, I need the property name. To specify in the order parameter.
😯 Current Behavior
Currently you get the title which is not stable
💁 Possible Solution
Add a ColumnId to each column which by default is set to the nameof(property) you’re using.
🔦 Context
I’m sending the property name to the server to have the server order the data for me, this does not work well if the column title is not the same as the property name.
In the feature I might also want a list of visible columns so I can generate a select parameter, and have the server only return the columns that are actually visible.
💻 Examples
GET /api/users?sort=givenName+desc
is what we want notGET /api/users?sort=Voornaam desc
The text was updated successfully, but these errors were encountered: