Skip to main content

DiagramCustomShapeBuilder.ToolboxTemplate(JS) Method

Mirrors the client-side toolboxTemplate option.

Namespace: DevExtreme.AspNet.Mvc.Builders

Assembly: DevExtreme.AspNet.Core.dll

Declaration

public DiagramCustomShapeBuilder ToolboxTemplate(
    JS value
)

Parameters

Name Type Description
value JS

A JavaScript function that specifies the template.

Returns

Type Description
DiagramCustomShapeBuilder

A reference to this instance after the method is called.

Remarks

This method allows you to define a custom shape toolbox template using a JavaScript function. You can access toolboxTemplate‘s parameters from this function. Refer to JavaScript Functions as Templates for more information.

@(Html.DevExtreme().Diagram()
    .CustomShapes(customShapes => {
        customShapes.Add().ToolboxTemplate(new JS("myDiagramCustomShape_toolboxTemplate"));
    })
)

<script>
    function myDiagramCustomShape_toolboxTemplate() {
        // Template rendering logic
    }
</script>
See Also