fulcro

sheluchin 2024-11-22T17:39:50.438379Z

In my RAD report, I have two columns: :foo/count and :foo/sentiment. I want to add some mobile-specific rendering, using CSS to hide/display certain columns according to screen resolution. For small screens, I want to combine :foo/count and :foo/sentiment into a single column, which is possible using ro/column-formatters and pulling the other value from props. On larger screens, I want to keep those columns separate so they can both be used for sorting. Is there some way to include a column twice, or create something like a "mock" column so that I can put whatever I want in it? Duplicating a column gives a warning like: > Warning: Encountered two children with the same key, col-:foo/count. Keys should be unique so that components maintain their identity across updates. Non-unique keys may cause children to be duplicated and/or omitted — the behavior is unsupported and could change in a future version. Error Component Stack --- Update: I suppose I could make a :foo/combined attribute with a resolver that just returns a throwaway value like :_ and then destructure props to get what I want. It works, but if there's a cleaner solution I'd love to learn about it.

tony.kay 2024-11-24T13:07:01.961269Z

you can certainly create a defattr for a “virtual” attribute and use that as a column. There is nothing that says that a defattr has to be in the database.

tony.kay 2024-11-24T13:07:36.282359Z

and you can make a resolver that returns whatever you want, based on the input of the row (row PK)