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

ISurfaceData Interface

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

A structure defining which product surfaces should be rendered and how to apply itemsData to them. For details, see the Personalized Rendering topic.

You can use this structure when defining a data set for personalization.

example
const data = {
    dataSet: {
        surfacesData: [{
            surfaceBinding: {
                // Render the first product page.
                surfaceIndexes: [0]
            },
            data: [{
                // Personalize the Name field.
                "Name": {
                    text: "Cristopher Bennett",
                    color: "rgb(48, 194, 255)"
                }
            }]
        }]
    }
};

Properties

data

data: IItemsData []

The personalization data.

Optional iterateOverSurfacesFirst

iterateOverSurfacesFirst: boolean

When you provide a number of data sets to render a number of surfaces, you can use this optional property to specify the rendering order. If this property is true, then it renders copies of the surfaces listed in the surfaceBinding when the outer loop iterates over surfaces and the inner loop iterates over data sets. If false, then the outer loop iterates over data sets and the inner loop iterates surfaces. The default value is false.

surfaceBinding

surfaceBinding: ISurfaceBinding

An array of either surface names or surface indexes that will be rendered.