moveContainer Method

Callable

  • moveContainer(initialIndex: number, destinationIndex: number ) : Container
  • Moves a channel container to a new position in the array of containers.

    example
    const containerIndex = 4;
    const destinationIndex = 3;
    
    // 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) {
                // Move a container.
                product.currentSurface.printAreas[0].moveContainer(containerIndex, destinationIndex);
            })
        });
    

    Parameters

    • initialIndex: number

      An index of the channel container to be moved (a value greater than two).

    • destinationIndex: number

      A new index of the container to be moved (a value greater than two).

    Returns Container

    An instance of the moved container.