-
QuestionI want to know the cost of using I've found only three differences between both implementations:
I see no problem with changing all my implementations from What I mean is that an The only obvious thing I can come off is that
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
Hey @luiscla27 , Separating the components allows for two important things - smaller bundles and API clarity. Even if you don't use a certain feature of tree-grid, it is part of the component and therefore you get it in your bundle. There is no reason to further increase that bundle size by adding all the other features that are simply not supported. Another important aspect is that this allows us to only include the API that is supported. So that you are not allowed to e.g. add Details template and assign Master-details related properties when tree grid doesn't support these. It's much better UX to not have this API in the first place than having to explain when and how it can be used, add checks, warnings, errors, etc. |
Beta Was this translation helpful? Give feedback.
-
Thanks so much for your quick answer @ChronosSF, The reason I'm asking this is because I wanted to encapsulate much of
I'm trying to encapsulate much of the grid definition into the
And my template would look something similar to this:
The reason I 'am considering to do that is because this approach will give me the benefits of polymorphism (and every class inheritance benefits you could think of), this would give me a huge advantage of scalability for my application. A quick example, let's say in my application I have 5 common auditable columns between all my entities, lets say "name", "created by", "creation date", "last modified date", "last modified by". With the TS definition I just explained I would already have all the code I need for a "base grid", the only thing I would need to vary from one implementation to another is the REST API from where I gather my data, and maybe add more columns, something like this:
What this means is that I would be able to create a lot of views querying different items with almost no effort at the frontpage. I wanted to explain you all this because maybe you can give some suggestion you could think of (that maybe I'm being blind to), my current main issue and the one I'm trying to address is that if want to have support for the But forgetting everything I just said and assuming not much can be done, my best option seems to just use |
Beta Was this translation helpful? Give feedback.
-
I suppose you'll ngFor the column collection in the underlying grid template? The issue I can see is that you can't really assign column templates like this. I don't see a huge issue having two encapsulation templates for the two grids. You can have it very minimal and assign most things through setters instead of the template (columns being the biggest exception from the rule). Apart from that the only issue you may have is if you want to use GroupBy as that works differently for igxTreeGrid. You can't use Master-Detail-style visualization in igxTreeGrid either. Performance should generally be comparable. |
Beta Was this translation helpful? Give feedback.
I suppose you'll ngFor the column collection in the underlying grid template? The issue I can see is that you can't really assign column templates like this.
I don't see a huge issue having two encapsulation templates for the two grids. You can have it very minimal and assign most things through setters instead of the template (columns being the biggest exception from the rule).
Apart from that the only issue you may have is if you want to use GroupBy as that works differently for igxTreeGrid. You can't use Master-Detail-style visualization in igxTreeGrid either. Performance should generally be comparable.