mui-x icon indicating copy to clipboard operation
mui-x copied to clipboard

[docs][Tree View] Add "Common examples" on the `RichTreeView` customization page

Open flaviendelangle opened this issue 1 year ago • 5 comments

The goal is to have good looking "Common examples" where the component used (SimpleTreeView or RichTreeView) is always the one people should use for this specific use-case

  • Move the "File explorer" example from the Simple Tree View to the Rich Tree View customization doc (might be a good opportunity to do #12286 or close it)

  • Create another examples based on @joserodolfofreitas experimentation with a basic 3D editor

  • Third examples for the RichTreeView? (not to be estimated yet)

Search keywords:

flaviendelangle avatar Mar 13 '24 10:03 flaviendelangle

It would be great to have some documentation on how to correctly use TreeItem2. I am trying to implement a lazy loading TreeItem2 and I can only see the file explorer example with it for open customization, but no explanation on what is doing any of the components or even the hook. Additionally, would be great as well to be able to provide a prop like hasChildren as a boolean. Internally only reading an array of children makes it quite rigid to achieve this lazy loading approach.

Ruffeng avatar May 16 '24 07:05 Ruffeng

Hi,

We clearly need more documentation around useTreeItem2 and TreeItem2.

Additionally, would be great as well to be able to provide a prop like hasChildren as a boolean. Internally only reading an array of children makes it quite rigid to achieve this lazy loading approach.

We aim at supporting lazy loading in the RichTreeView component, with a better DX than right now (which require a lot of hacky code). The main issue for this new feature is #9687

flaviendelangle avatar May 16 '24 08:05 flaviendelangle

Thanks for your quick answer @flaviendelangle . I will keep an eye on that issue, even though they are not aimed to be solved with the TreeItem2 yet.

Ruffeng avatar May 16 '24 09:05 Ruffeng

By the way, TreeItem2 will eventually become the only Tree Item component (it will replace TreeItem). So any new feature will be compatible with TreeItem2 (the opposite might now always be true depending on the complexity to support both.

flaviendelangle avatar May 16 '24 09:05 flaviendelangle

That's what I read in the docs. This is the reason why I am trying to do a lazy loading Rich tree view with TreeItem2 instead of the old one. If I come up with any success I will try to provide a gist to achieve such goal in case someone else needs to implement it and wants to use TreeItem2(until is officially supported for lazy loading).

Ruffeng avatar May 16 '24 10:05 Ruffeng