Lazy load and ui.tree #4897
A-n-d-r-e-a-s-M
started this conversation in
Show and tell
Replies: 1 comment 4 replies
-
Nice! Thank for sharing! 🙏 Do you think |
Beta Was this translation helpful? Give feedback.
4 replies
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.
-
Hi,
I am not yet fully familiar with nicegui's software design. With lazy load, the problem is that in tree.py(https://github.com/zauberzeug/nicegui/blob/main/nicegui/elements/tree.py) self.update() resets the view state. If the tree is per example expanded, you don't want that it collapses if you add a node. To overcome this problem, I wrote my own tree component (custom_tree.vue and custom_tree.py) with lazy load and added double click functionality. LazyLoadTree.py is the test program. When Quasar generates the lazy-load event, the corresponding data is sent to the server using this.$emit. A JavaScript promise is used to wait for the server, which then resolves the promise via a JavaScript method call.
LazyLoadTree.zip
Kind regards,
Andreas
Beta Was this translation helpful? Give feedback.
All reactions