You’re viewing outdated documentation. View the latest Customer’s Canvas On-Premises documentation.

getContainers Method

Applies to: Customer's Canvas On-Premises; Design Editor 6.15.0, 6.x (may differ) · Archived documentation

Callable

  • Gets an array of all containers in the print area.

    example
    // Load the editor.
    CustomersCanvas.IframeApi.loadEditor(iframe, productDefinition)
        // If the editor has been successfully loaded.
        .then(function (editor) {
            // When we get the product.
            editor.getProduct().then(function (product) {
                // Display obtained containers.
                console.log(product.currentSurface.printAreas[0].getContainers());
            });
        });

    Returns Container []

    An array of all containers in the print area. By default, each print area has three basic containers in the editor: Background, Main, and Foreground.