Spawn a Widget at runtime?

Is there a way to add a widget by clicking an add button while the prototype is running in the browser? Just curious…
The “Sheet Layer” and “Design Layer” list items are widgets and I wonder if I could add a new one at runtime…

you can use a similar technique like we use in the Data Binding Example. Here we simply clone the HTML Element and insert it again. Depending on your needs, this might suffice. Here a little example:

add item.zip (498.5 KB)

The “+”-Button contains the a script with two parameters (the cell to clone, and the container where to insert the cloned element). Does this help?

The downside of this approach is that Antetype itself does not know the new element, which might be a problem, but it depends on the circumstances.

1 Like

Sweet! Yes, it’s just what I need. Thanks Felix!