retejs / rete

JavaScript framework for visual programming
https://retejs.org
MIT License
10.17k stars 653 forks source link

Modify control inside worker #587

Closed OpenModDev closed 1 year ago

OpenModDev commented 2 years ago

How can i modify a control inside the worker function of a component?

Hatead1 commented 2 years ago

Modify what? Control type - delete control and create new one, control value - get control (let ctrl = this.editor.nodes.find(n => n.id === node.id).controls.get('control key') and call ctrl.setValue(val)

OpenModDev commented 2 years ago

i have a control that is a dropdown and i want to dynamically add more options to it

Hatead1 commented 2 years ago

add function (to control) like addOptions({name, value}) and add records to dropdown data array.

OpenModDev commented 2 years ago

yeah but the new options don't render

Ni55aN commented 2 years ago

probably you need to call the update method of control, if you need to re-render view

rete-js[bot] commented 1 year ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 10 days.