You are viewing an old version of this page. View the current version.
Compare with Current
View Page History
« Previous
Version 2
Next »
OpenSCD-Core can edit the current SCL Document by asynchronously listening to CustomEvents. If multiple EditEvents are sent that are depending on each other, it is possible to send a batch of them.
These CustomEvents can be divided into three types:
Insert
An Insert
EditEvent can be dispatched to insert new Elements into the current Document.
Update
An Update
EditEvent can be dispatched to change the Attributes of a provided Element from the current Document.
Remove
a Remove
EditEvent can be dispatched to remove an Element from the current Document.
eyJleHRTcnZJbnRlZ1R5cGUiOiIiLCJnQ2xpZW50SWQiOiIiLCJjcmVhdG9yTmFtZSI6IlBhc2NhbCBXaWxicmluayIsIm91dHB1dFR5cGUiOiJibG9jayIsImxhc3RNb2RpZmllck5hbWUiOiJQYXNjYWwgV2lsYnJpbmsiLCJsYW5ndWFnZSI6ImVuIiwiZGlhZ3JhbURpc3BsYXlOYW1lIjoiIiwic0ZpbGVJZCI6IiIsImF0dElkIjoiNjg2NzcyNzQiLCJkaWFncmFtTmFtZSI6IlNDTCBFZGl0RXZlbnRzIiwiYXNwZWN0IjoiIiwibGlua3MiOiJhdXRvIiwiY2VvTmFtZSI6Ik9wZW5TQ0QtY29yZSBoYW5kbGluZyBTQ0wgRWRpdHMiLCJ0YnN0eWxlIjoidG9wIiwiY2FuQ29tbWVudCI6ZmFsc2UsImRpYWdyYW1VcmwiOiIiLCJjc3ZGaWxlVXJsIjoiIiwiYm9yZGVyIjp0cnVlLCJtYXhTY2FsZSI6IjEiLCJvd25pbmdQYWdlSWQiOjY4Njc3MjcwLCJlZGl0YWJsZSI6ZmFsc2UsImNlb0lkIjo2ODY3NzI3OSwicGFnZUlkIjoiIiwibGJveCI6dHJ1ZSwic2VydmVyQ29uZmlnIjp7ImVtYWlscHJldmlldyI6IjEifSwib2RyaXZlSWQiOiIiLCJyZXZpc2lvbiI6MSwibWFjcm9JZCI6IjI1NmQ4NTNlLTNlM2EtNGE1Yi04MzczLTgzZDE5YTkwYWM5MCIsInByZXZpZXdOYW1lIjoiU0NMIEVkaXRFdmVudHMucG5nIiwibGljZW5zZVN0YXR1cyI6Ik9LIiwic2VydmljZSI6IiIsImlzVGVtcGxhdGUiOiIiLCJ3aWR0aCI6IjQxMSIsInNpbXBsZVZpZXdlciI6ZmFsc2UsImxhc3RNb2RpZmllZCI6MTY4NzUxMzM1MDgwMCwiZXhjZWVkUGFnZVdpZHRoIjpmYWxzZSwib0NsaWVudElkIjoiIn0=
Dispatching multiple events
If multiple EditEvents are sent that are depending on each other, for example to insert an Element with Sub-Elements, it is possible to send a batch of EditEvents.