Giter VIP home page Giter VIP logo

Comments (6)

slax57 avatar slax57 commented on April 28, 2024

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.

Dreamsorcerer avatar Dreamsorcerer commented on April 28, 2024

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.

slax57 avatar slax57 commented on April 28, 2024

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.

Dreamsorcerer avatar Dreamsorcerer commented on April 28, 2024

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.

fzaninotto avatar fzaninotto commented on April 28, 2024

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.

Dreamsorcerer avatar Dreamsorcerer commented on April 28, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.