Consider I have near 0% experience with typescript and now a little Hilla experience (which is going great!) please be gentle with me and provide a simple Tree Grid example.
I was hoping to do something easy like:
export class GroceryView extends View {
display a lovely tree view of master detail data.
}
But the examples on vaadin and hilla web sites started going into which was confusing...
export class Example extends LitElement {}
I have the grid working ok.
- Looked at the various document sources and github example projects.
- I have the basic grid working ok via the View implementation.
The
View
class in Hilla is actually an extension ofLitElement
. So if a documentation example usesLitElement
, you can copy the contents of that class to your view and expect it to work.The main difference between
View
andLitElement
is that aView
renders its template in its light DOM of the element, whereasLitElement
by default renders its template in its shadow DOM. This is becauseView
definescreateRenderRoot()
which returnsthis
instead ofthis.attachShadow()
.You should be able to copy-paste the first example in the docs to your
GroceryView
: https://vaadin.com/docs/latest/components/tree-gridI notice now, that the examples are not showing all the needed classes in them, mainly the
DataService
and thePerson
domain object. You can copy those from the docs repo: