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");
 
    // 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);
  }
}
See also
Back to top