Function $

  • Retrieves the binder if any.

    Parameters

    • n: string | HTMLElement | Event | Event<unknown>

      the object to look for. If it is a string, it is assumed to be UUID, unless it starts with '$'. For example, zkbind.$('uuid') is the same as zkbind.$('#uuid'), and both look for a widget whose ID is 'uuid'. On the other hand, zkbind.$('$id') looks for a widget whose ID is 'id'.
      and zkbind.$('.className') looks for a widget whose CSS selector is 'className'.
      If it is an DOM element (DOMElement), it will look up which widget it belongs to.
      If the object is not a DOM element and has a property called target, then target is assumed. Thus, you can pass an instance of jq.Event or zk.Event, and the target widget will be returned.

    • Optional opts: BinderOptions

      the options. Allowed values:

      • exact - id must exactly match uuid (i.e., uuid-xx ignored). It also implies strict
      • strict - whether not to look up the parent node.(since 5.0.2) If omitted, false is assumed (and it will look up parent).
      • child - whether to ensure the given element is a child element of the widget's main element (zk.Widget.$n). In most cases, if ID of an element is xxx-yyy, the the element must be a child of the element whose ID is xxx. However, there is some exception such as the shadow of a window.

    Returns Binder | undefined

    Since

    8.0.0