[FEATURE]: Allow for more flexible use of "collection" and "collectionView" #16681
enkelmedia
started this conversation in
Features and ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I was testing out the
collectionandcollectionViewas a way to render listings in my email package. These listings need to contain many of the building blocks that is provided withcollection, here's a mockup:The background is that I want to render these lists in several places. Sometimes with the filters/search and sometimes without. Sometimes I also need to render two lists in the same view but without any toolbar or pagination. I'm aware that maybe I'm trying to bend things to far here but I wanted to put my problem and ideas on the table.
One of my problems here is that the "collectionView" is a "view" and not just a rendered "collection" - it's kind of assumed that the collection will render alone in a "whole" section area. What I'm trying to do here is to render a "collection" (with it's toolbar, pagination etc.) but not the full view.
I looked at extension points for the collection and found that the core is extending the
UmbCollectionDefaultElementin a couple of places to customize the toolbar (e.g. in Users and Members). So I tried going down that path.Since my goal was to get rid of the wrapping
umb-body-layoutelement, I got stuck quite fast sinceUmbCollectionDefaultElementdoes not allow overriding the render-method.Still eager to get this to work I decided to just copy the file-content from the core into my own element and provide a property on my custom
NsCollectionDefaultElementthat would indicate if it needs to render the wrappingumb-body-layoutor not - this way I figured I could reuse the same element both when rendering as ainline collectionand acollection view.I was really happy and tried using my custom
ns-collection-default-elementinside a view just to realize that it needs to be wrapped inside theumb-collectionelement because this is the element that provides the context. Here I stumbled upon the same problem as therender()method of UmbCollectionElement is not overridable.I think that a potential solution to my problem would have been to create a class that extends UmbCollectionElement, override the render-method and return my
NsCollectionDefaultElementwith the settings i want.So a very long story here to outline the issue, like I said in the beginning - maybe this is trying to bend things to far?
If not, I'm wondering if you would be open to making the render-methods of
UmbCollectionElementandUmbCollectionDefaultElementprotected so that a extending class could override them?Or maybe this is a bigger question about making the
collectiona things that can be rendered outside acollectionViewin some way? Maybeumb-collection-inlineor something that does not wrap things insideumb-body-layout?Just to go against my own idea I know that the intention is to have the "select and bulk actions" show in the bottom toolbar of the view so IF my scenario above would be allowed it would still require me to rebuild the UI for this as well.
Anyway - now the issue is on the table and the air is free - maybe the right answer is: Just build your own element =D
Let me know what you think.
Cheers!
Beta Was this translation helpful? Give feedback.
All reactions