Replies: 2 comments 1 reply
-
Okay, so I guess the answer is to use markers, because the query method doesn’t seem to be iterable; it’s only finding one object. Now I’m facing an issue where ElementFilter isn’t retrieving objects in order, which kind of makes it pointless for my use case of collecting all data from multiple sortable lists. Any idea how to use the elementfilter in order? Else I would be required to iterate over "slots -> children - if type -> slots -> children" and so on and that would be tedious |
Beta Was this translation helpful? Give feedback.
-
Hello @phifuh According to my understanding, A MRE would certainly help. Thanks! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
First Check
Example Code
Description
I want to bind a custom class to the UI — in my case, it’s a sortable list — and I’m considering what the best practice would be. I could bind it to ui.row, mark it, and then query it with the ElementFilter, or I could use ui.element with a special tag and the query parameter.
Since a custom class doesn’t render anything in the frontend (as far as I know), the only effect I noticed is that a custom tag is added to the JS. Is there a smarter way to bind custom classes? I was hoping that ElementFilter would recognize a custom class, but it seems to only support native objects.
NiceGUI Version
2.x
Python Version
3.13
Browser
Chrome
Operating System
Linux
Additional Context
No response
Beta Was this translation helpful? Give feedback.
All reactions