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

update Method

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

Callable

  • Updates a channel container with new parameters.

    example
    // Initialize a product with the "card.psd" template and a channel container.
    const productDefinition = {
        surfaces: [{
            printAreas: [{
                designFile: "card",
                containers: [{
                    name: "foil",
                    type: "texture",
                    texture: "texture.jpg"
                }]
            }]
        }]
    };
    
    // 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) {
                // Get the fourth container.
                product.currentSurface.printAreas[0].getContainers()[3]
                    // Update this container with new parameters.
                    .update({
                        name: "SilverTexture",
                        texture: "silver-texture.jpg",
                        // Expects a translated string for the SILVER key in translations.json.
                        translationKey: "ObjectInspector.SILVER"
                    });
            });
        });

    Parameters

    Returns Promise < this >

    An instance of the updated container.