Docs (4.0.0)
class ManagedObject method

whence

Returns the containing (attached) managed object of this type, for the provided object.

static

static whence<T extends ManagedObject>(this: ManagedObject.Constructor<T>, object?: ManagedObject): T | undefined

Summary

This method finds and returns the closest containing object, i.e. parent, or parent’s parent, etc., which is an instance of the specific class on which this method is called. For example, calling ManagedObject.whence(obj) results in the first parent object, if any; however calling SomeClass.whence(obj) results in the one of the parents (if any) that’s actually an instance of SomeClass.

Parameters

  • object — The object for which to find the containing object

Return value

The closest containing (attached) object, which is an instance of the class on which this method is called.

Related

  • class ManagedObjectThe base class of all managed objects, which can be placed into a tree structure to enable event handling and data binding.