hilla
hilla copied to clipboard
[autogrid][dx] Consider providing a way for listing only the columns that should be hidden
Describe your motivation
As the default for AutoGrid is to show all the columns (there could be) 30-40 columns, using visibleColumns to hide a handful of columns is not convenient at all.
Describe the solution you'd like
Something like hiddenColumns that only gets the list of columns to be hidden is more convenient.
In this case, the visibleColumns can also be named as something like columnOrder since that's the only usage for it after defining a hiddenColumns property.
Describe alternatives you've considered
No response
Additional context
No response
The same concern came up several times in DX tests for AutoForm + AutoCrud.
Hey everyone 👋,
I recently came across this issue and I would like to work on it. At the moment, I can image the following use cases:
Consider a PersonModel with the following properties: firstName, lastName, gender and birthDate.
- Define visible columns and keep default order
- Configuration:
visibleColumns={['firstName', 'lastName', 'gender']} - Result:
firstName|lastName|gender
- Define hidden columns and keep default order
- Configuration:
hiddenColumns={['gender']} - Result:
firstName|lastName|birthDate
- Define visible columns and set custom order
- Configuration:
visibleColumns={['gender', 'firstName', 'lastName']} - Result:
gender|firstName|lastName
- Define visible columns, set custom order and hide certain columns
- Configuration:
visibleColumns={Object.getOwnPropertyNames(PersonModel.prototype).sort()}andhiddenColumns={['gender']} - Result:
birthDate|firstName|lastName
Would you agree to this? Do you have other use cases in mind?
@rbrki07 it is great that you're interested in working on this! :ok_hand:
Some considerations I can think of from the top of my mind:
-
Apart from the use cases directly related to the AutoGrid, we need to also think not only about the uniformity of the API names between AutoGrid and AutoForm, but also the be uniformity of the behaviours (of course the extent that it is meaningful).
-
Another property to consider is the customColumns and its effect on the order/visibility when it is used in conjunction with the other properties such as
visibleColumnsand/or the (new)hiddenColumns. -
To decide about the possible/valid combinations of these properties to be used at the same time, e.g. to through an error when certain combination of props are used at the same time to prevent over-engineered / complicated implementations and simplicity / fluency of the API which contributes to better DX and maintenance.
My comment here is just to expand the context, not to prevent contributions. Your thoughts/designs on this issue is very valuable and welcomed :hugs:
Thank you for your thoughts and your input @taefi. I'm not quite sure, how to take all of it into account. I think I will provide a pull request in the next couple of days and then we have some to talk about 😉