container()

Returns the page or widget containing the widget.

Copy
obj = Scrivito.Obj.root();
widgetlist = obj.get("body");
widget = widgetlist[0];
widget.container();
// => obj

A widget’s container is the Obj or Widget in one of whose widgetlist attributes the widget is contained. So this method allows you to determine the direct parent of a widget, e.g. for performing actions on it.

Params

None

Returns

Obj or Widget

See also

obj