Comments (6)
Thank you for your suggestion.
This seems like a very specific use-case, I'm not sure it's that common.
I suggest we wait for more feedback from the community before taking actions.
from react-admin.
Just to give an example, you could have a NumberField to display the value of a foreign key, a ReferenceField linking to the foreign record, and a field that displays a link to some external resource, all using the same source attribute. Another example could be a TextField showing a file name and a custom field that displays an audio player for that file. I suspect there are many examples of these around, they probably just haven't tried to omit one individually.
I think another issue is that you can't omit columns without a source. For example, putting an Edit button in the list view, it then can't be omitted by default, even though the user can hide it with the columns button.
from react-admin.
Okay I get your point, thanks for providing additional examples.
I'll mark this as enhancement then, so anyone can open a PR implementing this feature (remember to target the next
branch if your do).
Note that we probably won't work on this ourselves though, since we don't have that need on our own projects.
from react-admin.
So, the Columns button appears to use the column index. I'm not sure that's going to be a reliable way to implement this feature. Could we maybe extend omit so it matches the label or the source?
from react-admin.
The columns preference is a mix of availableColumns
(used to display the list of possible columns in SelectColumnsButtons) and columns
(which stores the user's choice regarding the orer and visibility of the columns). The second setting is related to the first one.
You have to consider that the feature must still work after the developer changes the number of orer of Fields in the datagrid, given users have already saved preferences.
from react-admin.
Right, so columns is actually the index listed in availableColumns. I'm not sure how that index is kept in sync with developer changes (presumably by checking for columns with the same source or label?).
But, availableColumns contains both source and label, which suggests to me that allowing omit to match the label would be a resonable approach?
from react-admin.
Related Issues (20)
- Selecting a choice from AutocompleteArrayInput within ReferenceArrayInput replaces existing choices HOT 2
- Tests heap size increase consequently after v4 migration HOT 1
- required() doesn't mark an input required HOT 2
- docs tutorial - cosmetic issue - URLField link does not point to the right URL HOT 2
- AutocompleteInput selects a value other than the highlighted one HOT 2
- FileInput - failed prop type of `removeIcon` HOT 1
- `ra-i18n-i18next` does not produce a `dist` folder when installing HOT 1
- enterprise-demo installation not working HOT 2
- Add rowDblClick prop to Datagrid HOT 1
- useController, update value when component mount (e.g useEffect) HOT 4
- Use of FormDataConsumer with a disabled TextInput creates a bad setState() HOT 6
- AutocompleteInput createLabel prop does not work. HOT 2
- ArrayInput has different behaviour in dev and in build HOT 2
- TextInput or BooleanInput default value not dynamic. HOT 1
- When 'name' field is null , Autocomplete optionText returns error even though i define inputText HOT 2
- TypeScript types are generated with unsafe types because strictNullChecks is false HOT 5
- DateInput, TimeInput, and DateTimeInput are inconsistent HOT 3
- target filters getting merged on using ReferenceManyField for the same reference in different pages HOT 2
- DeleteWithConfirmButton unsafely uses getRecordContext causing runtime error HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-admin.