Comments (6)
Regarding providing an example. An API for unbinding could be provided theoretically. So if there is a good use-case maybe its gonna be added.
from webui.
A propre unbind will be removing the ID from the core's table, and from webui.js
as well, new internal cmd is needed, and a new API. Need time to implement, but good to have.
Thank you @xland for the suggestion.
from webui.
You cant unbind it, but you can "ignore" events for specific IDs in your app
from webui.
How do I unbind it?
The webui.js
get generated at runtime based on your bind elements, and you can not unbind it. But, as @fibodevy said, you can easily ignore it in your back-end app.
what is the use of this ID?
Many wrappers has an internal table to map events with back-end functions, like Python wrapper, those wrappers use those IDs to identify the back-end function. So, you can save the IDs if you want and ignore their events later when you need, or use .element
to get the bind name (element name) instead of ID, whatever you prefer.
from webui.
Yes, as you mention @xland, the call to webui_bind
returns the ID. It is used e.g. to identify a function in an event. This would also allow to conditionally ignore the bound function when a state is reached where it is necessary, so you can store the ID and keep it in the relevant context.
Maybe you can share an example use-case for unbinding, then things can be further concertized.
from webui.
I didn't delve into the webui
code.
So I'm not sure if it's necessary to add the webui_unbind
API.
Let's say I'm going to keep creating btn in HTML : <button id='btn_n'>btn_n</button>
.
And keep binding events to those buttons : webui_bind(winId, "btn_n", same_function);
Then keep removing the previously created Button : document.getElementById("btn_n").remove();
This could be what happens when the user switches between tab pages.
btn_1
may be repeatedly bound to an event.
btn_999999...
may be bound to an event.
Does this cause OOM exception?
from webui.
Related Issues (20)
- Fix All Issues
- Fix All Core Bugs
- Build ARM CI with TLS HOT 1
- Update Documentation HOT 2
- auto update HOT 3
- Update Wrappers to 2.5.0.Beta.2 HOT 4
- feat: get all available browsers? HOT 2
- Accessibility Request: High Contrast Management HOT 3
- Idea: Development scaffolding similar to front-end HOT 5
- Perhaps the web UI could take inspiration from Blazor HOT 6
- Examples build on ARM for Windows issue HOT 2
- Is webui.js needed when webui_show() is for type WEBUI_SHOW_URL? HOT 2
- example bug, segment fault HOT 1
- webui_wait() returns when device goes to sleep. HOT 3
- Is it possible to embed web resources? HOT 3
- Using zig cc HOT 7
- Strange Behavior HOT 11
- Latest changes makes examples crash on macos HOT 5
- Segfault on dynamically linked library when built with `make WEBUI_USE_TLS=1` HOT 6
- Translating WebUI website HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from webui.