Unsure how to change header properties with .update()

What would the syntax be for updating the fill and of a header in a group or swimlane? I tried this:

editor.diagram.data.update(id, {
header: {
fill: “#000000
},
});

But it replaces all values inside header {} to just {fill: “#000000”} which removes the whole header from the element.

Hello @Theodor ,

The issue occurs because you are updating swimline incorrectly.

The best approach will be to get the swimline data => update required property => call the data.update method with the updated data:

const swimlaneData = editor.diagram.data.getItem("main");
swimlaneData.header.fill = "aqua";
editor.diagram.data.update("main", swimlaneData);

Here is an example:
https://snippet.dhtmlx.com/7l2s17br

Kind regards,