getScopedWixEditor( )


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

The getScopedWixEditor() function lets you use wix-editor 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.

Method Declaration
Copy
function getScopedWixEditor(Selector: string): Promise<object>;
Method Parameters
SelectorstringRequired

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
Return Type:Promise<object>
Removes an element in an inner (nested) widget
JavaScript
import wixEditor from "wix-editor"; // ... wixEditor .getScopedWixEditor("#nestedWidget1 #nestedWidget2") ////nestedWidget2 is inside nestedWidget1 .then((nestedWidget) => { nestedWidget.removeElement("#title1"); //removes title1 from nestedWidget2 });
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?