Hi Nikolay,
This is the Javascript that is in the Suzuki example with the layer toggling on clicking shapes:
$.each(diagram.shapes, function (shapeId, shape) {
var $shape = $("#" + shapeId);
$shape.css("cursor", 'pointer');
if (!shape.Props || !shape.Props.nets)
return;
$shape.on('click', function (evt) {
evt.stopPropagation();
var nets = shape.Props.nets;
var allVisible = true;
$.each(nets.split(";"), function(k,v) {
var name = v.trim();
if (!diagram.isLayerVisible(name))
allVisible = false;
});
$.each(nets.split(";"), function(k,v) {
var name = v.trim();
diagram.setLayerVisible(name, !allVisible);
});
});
});
This works well in other diagrams (I add the layers to be toggled on specific shapes to the 'nets' shape data string field on that shape).
What I need is a way to turn off specific layers when the diagram is initially loaded in the browser (most layers I use are turned off by default), how can I achieve that?
I assume this can be achieved by adding some Javascript, if you can send me an example and where to add it please (my VBA/VB.NET is getting better but my Javascript knowledge is minimal).
Thank you!