save

handler fired when the data are saved

function save;

Example

webix.ui({
  view: "diagram-editor",
  id: "editor",
  shapes: shapes,
  save: () => {
  // handler logic
  },
});

Related samples

Details

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");
 
    // blocks, links, shapes, defaults for blocks and links
    const full_data = $$("editor").getValues();
    diagram.parse(full_data);
    $$("view").show();
  }
}
See also
Back to top