handler fired when the data are saved
webix.ui({
view: "diagram-editor",
id: "editor",
shapes: shapes,
save: () => {
// handler logic
},
});
The handler is executed when the user clicks on the "Apply" button. You can use the property to save the changed data back to diagram like so:
{
view: "diagram-editor",
id: "editor",
shapes: [/* shapes config */],
save: () => {
const diagram = $$("diagram");
// clear old data
diagram.clearAll();
diagram.getLinks().clearAll();
// get blocks, links, shapes, defaults for blocks and links
const full_data = $$("editor").getValues();
// parse new data
diagram.parse(full_data);
}
}