Search.../

getNestedWidget( )

Gets the wix-widget module scoped to an inner (nested) widget.

Description

The getNestedWidget() function lets you use wix-widget functions on inner (nested) widgets. It receives a selector of an inner widget and returns a promise that resolves with an object representing the scope of the inner widget.

Syntax

function getNestedWidget(Selector: string): Promise<Object>

getNestedWidget Parameters

NAME
TYPE
DESCRIPTION
Selector
string

A string of one or more nested widget selectors, which can include a few levels of nesting from outer to inner, separated by spaces. For example: ("#nestedWidget1"), or ("#nestedWidget1 #nestedWidget2").

Returns

Fulfilled - The wix-widget module scoped to the nested widget

Return Type:

Promise<Object>

Was this helpful?

Get a nested widget's preset

Copy Code
1import wixWidget from 'wix-widget';
2
3//...
4
5wixWidget.getNestedWidget("#nestedWidget1 #nestedWidget2") //nestedWidget2 is inside nestedWidget1
6 .then((nestedWixWidget) => nestedWixWidget.getDesignPreset())
7 .then((nestedWidgetPreset) => {
8 // do something with the design preset of nestedWidget2
9 });