Optional props: Record<string, unknown> | (() => void)Optional $ZKBINDER$Optional $ZKMATCHMEDIA$Optional $buttonOptional $inputThe object ID. Each object has its own unique $oid. It is mainly used for debugging purpose.
Trick: you can test if a JavaScript object is a ZK object by examining this property, such as `if (o.$oid) alert('o is a ZK object');`
Notice: zk.Class extends from zk.Object (so a class also has $oid)
Optional $weaveThe weave controller that is used by ZK Weaver. It is not null if it is created and controlled by ZK Weaver. In other words, it is called in the Design Mode if Widget.$weave is not null.
Optional autagThe AU tag of this widget.
The AU tag tag is used to tag the AU requests sent by the peer widget.
For instance, if the AU tag is xxx,yyy and the desktop's
request path (Desktop#requestPath) is /foo.zul, then
the URL of the AU request will contain /_/foo.zul/xxx,yyy,.
null
6.0.0
Readonly bindThe bind level (integer).
The level in the widget tree after this widget is bound to a DOM tree (bind_). For example, a widget's bind level is one plus the parent widget's
It starts at 0 if it is the root of the widget tree (a desktop, zk.Desktop), then 1 if a child of the root widget, and son on. Notice that it is -1 if not bound.
It is mainly useful if you want to maintain a list that parent widgets is in front of (or after) child widgets. bind level.
Optional blankThe class name of the widget. For example, zk.Widget's class name is "zk.Widget", while zul.wnd.Window's "zul.wnd.Window".
Notice that it is available if a widget class is loaded by WPD loader (i.e., specified in zk.wpd). If you create a widget class dynamically, you have to invoke register to make this member available. On the other hand, zk.Object.$class is available for all objects extending from zk.Object.
widgetName
Optional Readonly desktopThe desktop that this widget belongs to.
It is set when it is bound to the DOM tree.
Notice it is always non-null if bound to the DOM tree, while Widget.$n is always non-null if bound. For example, zul.utl.Timer.
It is readonly, and set automatically when bind_ is called.
Optional domOptional Readonly firstThe first child, or null if no child at all.
getChildAt
Optional Readonly idReadonly inWhether this widget has a peer component.
It is set if a widget is created automatically to represent a component
at the server. On the other hand, it is false if a widget is created
by the client application (by calling, say, new zul.inp.Textox()).
Optional Readonly lastThe last child, or null if no child at all.
getChildAt
Readonly nThe number of children (integer).
Optional Readonly nextThe next sibling, or null if this widget is the last child.
Optional offsetOptional offsetOptional Readonly parentThe parent, or null if this widget has no parent.
Optional Readonly previousThe previous sibling, or null if this widget is the first child.
Optional prologThe UUID. Don't change it if it is bound to the DOM tree, or inServer is true. Developers rarely need to modify it since it is generated automatically.
The widget name of the widget.
It is the same as this.className.substring(this.className.lastIndexOf('.') + 1).toLowerCase().
For example, if className is zul.wnd.Window, then
widgetName is window.
Notice that className is unique while widgetName is not necessary unique.
className
5.0.2
Optional z$displayOptional z$rodOptional z$rod0Optional z_Optional z_Static $oidStatic auThe default delay before sending an AU request when fire is called (and the server has an ARAP event listener registered).
38 (Unit: miliseconds).
5.0.8
Static moldsthe map of all fellows of this widget.
wgt.$f().main.setTitle("foo");
5.0.2
the widget's ID (id)
Optional global: booleanwhether to search all ID spaces of this desktop. If true, it first search its own ID space, and then the other Id spaces in this browser window (might have one or multiple desktops). If omitted, it won't search all ID spaces.
the fellow (Widget) of the specified ID of the ID space that this widget belongs to. It returns undefined if not found.
Determines if this object is an instance of the class represented by the specified Class parameter. Example:
if (obj.$instanceof(zul.wgt.Label, zul.wgt.Image)) {
}
Rest ...klass: any[]the Class object to be checked. Any number of arguments can be specified.
true if this object is an instance of the class
the DOM element that this widget is bound to. It is null if it is not bound to the DOM tree, or it doesn't have the associated DOM node (for example, zul.utl.Timer).
Notice that desktop is always non-null if it is bound to the DOM tree. In additions, this method is much faster than invoking jq() (see _global_.jq, since it caches the result (and clean up at the unbind_). ```ts var n = wgt.$n(); ```
#$n(String)
Optional subId: stringthe sub ID of the child element
the child element of the DOM element(s) that this widget is bound to. This method assumes the ID of the child element the concatenation of uuid, -, and subId. For example,
var cave = wgt.$n('cave'); //the same as jq('#' + wgt.uuid + '-' + 'cave')[0]
Like Widget.$n, this method caches the result so the performance is much better than invoking jq() directly.
Widget.$n
the DOM element that this widget is bound to. (Never null)
Widget.$n_
10.0.0
the sub ID of the child element
the child element of the DOM element(s) that this widget is bound to. (Never null)
Widget.$n_
10.0.0
Optional subclass: stringthe sub zclass name that cache for this widget. It returns the zclass if the subclass is empty or null, since it caches the result (and clean up at the setZclass).
var subzcls = wgt.$s('hover'); // z-xxx-hover will be return
Invokes a method defined in the superclass with any number of arguments. It is like Function's call() that takes any number of arguments.
Example: ```ts multiply: function (n) { return this.$super('multiply', n + 2); } ```
the object being returned by the method of the superclass.
Invokes a method defined in the superclass with any number of arguments. It is like Function's call() that takes any number of arguments.
It is similar to ZKObject.$super, but this method works even if the superclass calls back the same member method. In short, it is tedious but safer.
Example: ```ts foo.MyClass = zk.$extends(foo.MySuper, { multiply: function (n) { return this.$super(foo.MyClass, 'multiply', n + 2); } ```
Notice that the class specified in the first argument is not the super class having the method. Rather, it is the class that invokes this method.
the object being returned by the method of the superclass.
Invokes a method defined in the superclass with an array of arguments. It is like Function's apply() that takes an array of arguments.
Example: ```ts multiply: function () { return this.$supers('multiply', arguments); } ```
the object being returned by the method of the superclass.
Invokes a method defined in the superclass with an array of arguments. It is like Function's apply() that takes an array of arguments.
It is similar to zk.Object.$supers, but this method works even if the superclass calls back the same member method. In short, it is tedious but safer.
Example: ```ts foo.MyClass = zk.$extends(foo.MySuper, { multiply: function () { return this.$supers(foo.MyClass, 'multiply', arguments); } ```
Notice that the class specified in the first argument is not the super class having the method. Rather, it is the class that invokes this method.
the object being returned by the method of the superclass.
Invoked after an animation (e.g., zjq.slideDown) has finished. You could override to clean up anything related to animation. Notice that, if you override, you have to call back this method.
whether the result of the animation will make the DOM element visible
5.0.6
Optional kid: Widget<HTMLElement>Specifies a function that shall be called after the object is initialized, i.e., after zk.Object.$init is called. This method can be called only during the execution of zk.Object.$init.
It is an advance feature that is used to allow a base class to do something that needs to wait for all deriving classes have been initialized.
Invocation Sequence:
the function to register for execution later
Append a child widget. The child widget will be attached to the DOM tree automatically, if this widget has been attached to the DOM tree, unless this widget is zk.Desktop. In other words, you have to attach child widgets of zk.Desktop manually (by use of, say, replaceHTML).
whether the widget was added successfully. It returns false if the child is always the last child (lastChild).
A callback called before removing a child.
the child being removed.
10.0.0
Callback before sending an AU request. It is called by sendAU_.
this method will stop the event propagation
and prevent the browser's default handling
(by calling {@link zk.Event#stop}),
if the event is onClick, onRightClick or onDoubleClick.
<p>Notice that {@link sendAU_} is called against the widget sending the AU request
to the server, while {@link beforeSendAU_} is called against the event's
target (evt.target).
<p>Notice that since this method will stop the event propagation for onClick,
onRightClick and onDoubleClick, it means the event propagation is stopped
if the server registers a listener. However, it doesn't stop if
only a client listener is registered (and, in this case, {@link zk.Event#stop}
must be called explicitly if you want to stop).
5.0.2
Binds this widget. It is called to associate (aka., attach) the widget with the DOM tree.
Notice that you rarely need to invoke this method, since it is called automatically (such as replaceHTML and appendChild).
Notice that you rarely need to override this method, either. Rather, override bind_ instead.
Binds the children of this widget. It is called by bind_ to invoke child's bind_ one-by-one.
Optional desktop: Desktopthe desktop the DOM element belongs to. If not specified, ZK will decide it automatically.
Optional skipper: Skipperused if rerender is called with a non-null skipper.
Optional after: CallableFunction[]an array of function (Function) that will be invoked after bind_ has been called. For example,
5.0.5
Checks if this widget can be activated (gaining focus and so on).
Optional opts: Partial<{ the options. Allowed values:
return false if it is not a descendant of
{@link _global_.zk#currentModal}.
Cleans up the widget to make it un-draggable. It is called if getDraggable is cleaned (or unbound).
You rarely need to override this method, unless you want to handle drag-and-drop differently.
Called to create the visual effect representing what is being dragged. In other words, it creates the DOM element that will be moved with the mouse pointer when the user is dragging.
This method is called if getDragMessage_ returns null. If getDragMessage_ returns a string (empty or not), a small popup containing the message is created to represent the widget being dragged.
You rarely need to override this method, unless you want a different visual effect.
the draggable controller
the offset of the returned element (left/top)
Renders a fake DOM element that will replace with the correct element after the deferring time is up. The method is designed for some widgets to override, such as Treeitem, Listitem, and Row, whose HTML tag is created inside a table.
By default, the Div tag is assumed.
an array to output the HTML fragments.
5.0.6
Utilities for handling the so-called render defer (setRenderdefer). This method is called automatically by redraw, so you only need to use it if you override redraw.
A typical usage is as follows. ```ts redraw: function (out) { if (!this.deferRedraw_(out)) { out.push(...); //redraw } } ```
an array to output the HTML fragments.
5.0.2
A utility to simplify the listening of onBlur.
Unlike other doXxx_ (such as doClick_), a widget needs to listen
the onBlur event explicitly if it might gain and lose the focus.
For example, ```ts var fn = this.$n('focus'); this.domListen_(fn, 'onFocus', 'doFocus_'); this.domListen_(fn, 'onBlur', 'doBlur_'); ```
Of course, you can listen it with jQuery DOM-level utilities, if you pefer to handle it differently.
the widget event. The original DOM event and target can be retrieved by zk.Event#domEvent and zk.Event#domTarget
fire the widget event ({@link fireX}), and
call parent's doBlur_ if the event propagation is not stopped ({@link zk.Event#stopped}).
It is the so-called event propagation.
<p>See also <a href="http://books.zkoss.org/wiki/ZK_Client-side_Reference/Notifications">ZK Client-side Reference: Notifications</a>
Called when the user double-clicks on a widget or a child widget. A widget doesn't need to listen the dblclick DOM event. Rather, it shall override this method if necessary.
the widget event. The original DOM event and target can be retrieved by zk.Event#domEvent and zk.Event#domTarget
fire the widget event ({@link fireX}), and call parent's
doDoubleClick_ if the event propagation is not stopped ({@link zk.Event#stopped}).
It is the so-called event propagation.
<p>Note: if {@link shallIgnoreClick_} returns true, {@link fireX} won't be
called and this method invokes the parent's {@link doDoubleClick_} instead
(unless {@link zk.Event#stopped} is set).
<p>See also <a href="http://books.zkoss.org/wiki/ZK_Client-side_Reference/Notifications">ZK Client-side Reference: Notifications</a>
A utility to simplify the listening of onFocus.
Unlike other doXxx_ (such as doClick_), a widget needs to listen
the onFocus event explicitly if it might gain and lose the focus.
For example, ```ts var fn = this.$n('focus'); this.domListen_(fn, 'onFocus', 'doFocus_'); this.domListen_(fn, 'onBlur', 'doBlur_'); ```
Of course, you can listen it with jQuery DOM-level utilities, if you pefer to handle it differently.
the widget event. The original DOM event and target can be retrieved by zk.Event#domEvent and zk.Event#domTarget
fire the widget event ({@link fireX}), and
call parent's doFocus_ if the event propagation is not stopped ({@link zk.Event#stopped}).
It is the so-called event propagation.
<p>See also <a href="http://books.zkoss.org/wiki/ZK_Client-side_Reference/Notifications">ZK Client-side Reference: Notifications</a>
Called when the user presses a key when this widget has the focus (focus).
Notice that not every widget can have the focus. A widget doesn't need to listen the keypress DOM event. Rather, it shall override this method if necessary.
the widget event. The original DOM event and target can be retrieved by zk.Event#domEvent and zk.Event#domTarget
fire the widget event ({@link fireX}), and
call parent's doKeyPress_ if the event propagation is not stopped ({@link zk.Event#stopped}).
It is the so-called event propagation.
<p>See also <a href="http://books.zkoss.org/wiki/ZK_Client-side_Reference/Notifications">ZK Client-side Reference: Notifications</a>
Called when the user presses up a key when this widget has the focus (focus).
Notice that not every widget can have the focus. A widget doesn't need to listen the keyup DOM event. Rather, it shall override this method if necessary.
the widget event. The original DOM event and target can be retrieved by zk.Event#domEvent and zk.Event#domTarget
fire the widget event ({@link fireX}), and
call parent's doKeyUp_ if the event propagation is not stopped ({@link zk.Event#stopped}).
It is the so-called event propagation.
<p>See also <a href="http://books.zkoss.org/wiki/ZK_Client-side_Reference/Notifications">ZK Client-side Reference: Notifications</a>
Called when the user presses down the mouse button on this widget (or one of its child widget). A widget doesn't need to listen the mousedown DOM event. Rather, it shall override this method if necessary.
the widget event. The original DOM event and target can be retrieved by zk.Event#domEvent and zk.Event#domTarget
fire the widget event ({@link fireX}), and
call parent's doMouseDown_ if the event propagation is not stopped ({@link zk.Event#stopped}).
<p>See also <a href="http://books.zkoss.org/wiki/ZK_Client-side_Reference/Notifications">ZK Client-side Reference: Notifications</a>
Called when the user moves the mouse pointer over this widget (or one of its child widget). A widget doesn't need to listen the mousemove DOM event. Rather, it shall override this method if necessary.
the widget event. The original DOM event and target can be retrieved by zk.Event#domEvent and zk.Event#domTarget
fire the widget event ({@link fireX}), and
call parent's doMouseMove_ if the event propagation is not stopped ({@link zk.Event#stopped}).
It is the so-called event propagation.
<p>See also <a href="http://books.zkoss.org/wiki/ZK_Client-side_Reference/Notifications">ZK Client-side Reference: Notifications</a>
Called when the user moves the mouse pointer out of a widget (or one of its child widget). A widget doesn't need to listen the mouseout DOM event. Rather, it shall override this method if necessary.
the widget event. The original DOM event and target can be retrieved by zk.Event#domEvent and zk.Event#domTarget
fire the widget event ({@link fireX}), and
call parent's doMouseOut_ if the event propagation is not stopped ({@link zk.Event#stopped}).
Called when the user moves the mouse pointer on top of a widget (or one of its child widget). A widget doesn't need to listen the mouseover DOM event. Rather, it shall override this method if necessary.
the widget event. The original DOM event and target can be retrieved by zk.Event#domEvent and zk.Event#domTarget
fire the widget event ({@link fireX}), and
call parent's doMouseOver_ if the event propagation is not stopped ({@link zk.Event#stopped}).
<p>See also <a href="http://books.zkoss.org/wiki/ZK_Client-side_Reference/Notifications">ZK Client-side Reference: Notifications</a>
Called when the user presses up the mouse button on this widget (or one of its child widget). A widget doesn't need to listen the mouseup DOM event. Rather, it shall override this method if necessary.
the widget event. The original DOM event and target can be retrieved by zk.Event#domEvent and zk.Event#domTarget
fire the widget event ({@link fireX}), and
call parent's doMouseUp_ if the event propagation is not stopped ({@link zk.Event#stopped}).
It is the so-called event propagation.
<p>See also <a href="http://books.zkoss.org/wiki/ZK_Client-side_Reference/Notifications">ZK Client-side Reference: Notifications</a>
Called when the user paste text to this widget which has been the focused (focus).
Notice that not every widget can have the focus. A widget doesn't need to listen the paste DOM event. Rather, it shall override this method if necessary.
the widget event. The original DOM event and target can be retrieved by zk.Event#domEvent and zk.Event#domTarget
fire the widget event ({@link fireX}), and
call parent's doPaste_ if the event propagation is not stopped ({@link zk.Event#stopped}).
It is the so-called event propagation.
<p>See also <a href="http://books.zkoss.org/wiki/ZK_Client-side_Reference/Notifications">ZK Client-side Reference: Notifications</a>
Called when the user clicks or right-clicks on widget or a child widget. It is called before doClick_ and doRightClick_.
the widget event. The original DOM event and target can be retrieved by zk.Event#domEvent and zk.Event#domTarget
does nothing but invokes the parent's {@link doSelect_}.
Notice that it does not fire any event.
<p>Deriving class that supports selection (such as {@link zul.sel.ItemWidget})
shall override this to handle the selection.
<p>Technically, the selection can be handled in {@link doClick_}.
However, it is better to handle here since this method is invoked first
such that the widget will be selected before one of its descendant widget
handles {@link doClick_}.
<p>Notice that calling {@link zk.Event#stop} will stop the invocation of
parent's {@link doSelect_} and {@link doClick_}/{@link doRightClick_}.
If you just don't want to call parent's {@link doSelect_}, simply
not to invoke super's doSelect_.
5.0.1
Called when the user swipe left/right/up/down this widget.
For example, ```ts var opts = evt.opts, dir = opts.dir; switch (dir) { case 'left': doSwipeLeft(); break; case 'right': doSwipeRight(); break; case 'up': doSwipeUp(); break; case 'down': doSwipeDown(); break; } ``` To define swipe direction rather than default condition, ```ts var opts = evt.opts, start = opts.start, stop = opts.stop, dispT = stop.time - start.time, deltaX = start.coords[0] - stop.coords[0], deltaY = start.coords[1] - stop.coords[1], dispX = Math.abs(deltaX), dispY = Math.abs(deltaY);
//if swipe time is less than 500ms, it is considered as swipe event if (dispT < 500) { //if horizontal displacement is larger than 30px and vertical displacement is smaller than 75px, it is considered swipe left/right if (dispX > 30 && dispY < 75) //swipe left if deltaX > 0
//if vertical displacement is large than 30px and horizontal displacement is smaller than 75px, it is considered swipe up/down else if (dispY > 30 && dispX < 75) //swipe up if deltaY > 0 } ```
the widget event.
fire the widget event ({@link fireX}), and
call parent's doSwipe_ if the event propagation is not stopped ({@link zk.Event#stopped}).
It is the so-called event propagation.
6.5.0
Optional no: DomClassOptions[options] the style class to exclude (i.e., to turn off).
If omitted, it means none (i.e., all included). For example, you don't
want sclass to generate, call domClass_({sclass:1}).
Notice, though a bit counter-intuition, specify 1 (or true) to denote exclusion.
Allowed value (subclass might support more options):
the class name(s) used for the DOM element of this widget, such as "z-button foo"
Registers an DOM event listener for the specified DOM element (aka., node). You can use jQuery to listen the DOM event directly, or use this method instead.
bind_: function () {
this.$supers('bind_', arguments);
this.domListen_(this.$n(), "onChange"); //fn is omitted, so _doChange is assumed
this.domListen_(this.$n("foo"), "onSelect", "_doFooSelect"); //specify a particular listener
},
unbind_: function () {
this.domUnlisten_(this.$n(), "onChange"); //unlisten
this.domUnlisten_(this.$n("foo"), "onSelect", "_doFooSelect");
this.$supers('unbind_', arguments);
},
_doChange_: function (evt) { //evt is an instance of zk.Event
//event listener
},
_doFooSelect: function (evt) {
}
See also ZK Client-side Reference: Notifications
a node of this widget. It is usually retrieved by Widget.$n.
the event name to register, such as onClick.
Optional fn: string | CallableFunctionthe name (String) of the member method to handle the event,
or the function (Function).
It is optional. If omitted, _doEvtnm is assumed, where evtnm
is the value passed thru the evtnm argument.
For example, if the event name is onFocus, then the method is assumed to be
_doFocus.
Optional keyword: unknownthe extra argumenet for the function, which is passed into the callback function. (since 7.0)
Optional no: DomStyleOptions[options] the style to exclude (i.e., to turn off).
If omitted, it means none (i.e., all included). For example, you don't
want width to generate, call domStyle_({width:1}).
Notice, though a bit counter-intuition, specify 1 (or true) to denote exclusion.
Allowed value (subclass might support more options):
the style used for the DOM element of this widget, such as "width:100px;z-index:1;"
the style attribute that contains only the text related CSS styles. For example, it returns style="font-size:12pt;font-weight:bold" if #getStyle is border:none;font-size:12pt;font-weight:bold.
It is usually used with getTextNode to ZK Client-side Reference: Text Styles and Inner Tags.
the tooltiptext for generating the title attribute of the DOM element.
return {@link getTooltiptext}.
<p>Deriving class might override this method if the parent widget
is not associated with any DOM element, such as treerow's parent: treeitem.
5.0.2
Un-registers an event listener for the specified DOM element (aka., node).
Refer to domListen_ for more information.
the event name to register, such as onClick.
Optional fn: string | CallableFunctionthe name (String) of the member method to handle the event,
or the function (Function).
It is optional. If omitted, _doEvtnm is assumed, where evtnm
is the value passed thru the evtnm argument.
For example, if the event name is onFocus, then the method is assumed to be
_doFocus.
Optional keyword: unknownthe extra argumenet for the function, which is passed into the callback function. (since 7.0)
Called to have some visual effect when the user is dragging a widget over this widget and this widget is droppable. Notice it is the effect to indicate a widget is droppable.
Optional over: booleanwhether the user is dragging over (or out, if false)
it adds the CSS class named 'z-drag-over' if over is true, and remove it if over is false.
Associates UUID with this widget.
Notice that uuid is automatically associated (aka., bound) to this widget. Thus, you rarely need to invoke this method unless you want to associate with other identifiers.
For example, ZK Google Maps uses this method since it has to bind the anchors manually.
the UUID to assign to the widgtet
whether to bind. Specify true if you want to bind; false if you want to unbind.
Fire a widget event. An instance of zk.Event is created to represent the event.
The event listeners for this event will be called one-by-one unless zk.Event#stop is called.
If the event propagation is not stopped (i.e., zk.Event#stop not called) and inServer is true, the event will be converted to an AU request and sent to the server. Refer to ZK Client-side Reference: AU Requests: Client-side Firing for more information.
the event name, such as onClick
Optional data: unknownthe data depending on the event (zk.Event).
Optional opts: EventOptionsthe options. Refer to zk.Event#opts
Optional timeout: numberthe delay before sending the non-deferrable AU request (if necessary). If not specified or negative, it is decided automatically. It is ignored if no non-deferrable listener is registered at the server.
the event being fired.
Fire a widget event.
the event to fire
Optional timeout: numberthe delay before sending the non-deferrable AU request (if necessary). If not specified or negative, it is decided automatically. It is ignored if no non-deferrable listener is registered at the server.
the event being fired, i.e., evt.
Sets the focus to this widget. This method will check if this widget can be activated by invoking canActivate first.
Notice: don't override this method. Rather, override focus_, which this method depends on.
Optional timeout: numberhow many milliseconds before changing the focus. If not specified or negative, the focus is changed immediately,
whether the focus is gained to this widget.
Called by focus to set the focus.
Optional timeout: numberhow many milliseconds before changing the focus. If not specified or negative, the focus is changed immediately,
whether the focus is gained to this widget.
call child widget's focus until it returns true, or no child at all.
5.0.5
Forces the rendering if it is deferred. A typical way to defer the render is to specify setRenderdefer with a non-negative value. The other example is some widget might be optimized for the performance by not rendering some or the whole part of the widget. If the rendering is deferred, the corresponding DOM elements (Widget.$n) are not available. If it is important to you, you can force it to be rendered.
Notice that this method only forces this widget to render. It doesn't force any of its children. If you want, you have invoke forcerender one-by-one
The derived class shall override this method, if it implements the render deferring (other than setRenderdefer).
5.0.2
Converts a coordinate related to the browser window into the coordinate related to this widget.
the X coordinate related to the browser window
the Y coordinate related to the browser window
the coordinate related to this widget (i.e., [0, 0] is the left-top corner of the widget).
5.0.2
Called by insertChildHTML_ to find the location to place the DOM element of the child. More precisely, the node returned by getCaveNode is the parent DOM element of the child's DOM element.
this.$n('cave') || this.$n()
You can override it to return whatever DOM element you want.
the index of the child widget to return. 0 means the first child, 1 for the second and so on.
Optional skipHidden: booleanwhether to skip hidden child widgets, defaults to false.
the child widget at the specified index or null if no such index.
Notice this method is not good if there are a lot of children since it iterates all children one by one.
the child index of this widget. By child index we mean the order of the child list of the parent. For example, if this widget is the parent's first child, then 0 is returned.
Notice that getChildAt is called against the parent, while this method called against the child. In other words, `w.parent.getChildAt(w.getChildIndex())` returns `w`.
Notice this method is not good if there are a lot of children since it iterates all children one by one.
the ID of the popup (zul.wgt.Popup) that should appear when the user right-clicks on the element (aka., context menu).
null (no context menu).
Optional fn: string | CallableFunctionOptional keyword: unknownthe message to show when an user is dragging this widget, or null if it prefers to clone the widget with cloneDrag_.
it return the inner text if if {@link Widget.$n} returns a TR, TD, or TH element. Otherwise, it returns null and {@link cloneDrag_} will be called to create a DOM element to indicate dragging.
<p>Notice that the text would be encoded for XSS issue since 8.0.4.2. It should be considered when overriding.
the default implementation
the options used to instantiate zk.Draggable.
it does nothing but returns the map parameter,
i.e., the default options.
Though rarely used, you can override any option passed to zk.Draggable, such as the start effect, ghosting and so on.
the widget being dragged (never null).
the widget if it allows to drop the specified widget (being dragged), or null if not allowed. It is called when the user is dragging a widget on top a widget.
it check if the values of droppable and draggable match. It will check the parent ({@link parent}), parent's parent, and so on until matched, or none of them are matched.
<p>Notice that the widget to test if droppable might be the same as the widget being dragged (i.e., this == dragged). By default, we consider them as non-matched.
the first DOM element of this widget. If this widget has no corresponding DOM element, this method will look for its siblings.
This method is designed to be used with insertChildHTML_ for retrieving the DOM element of the `before` widget.
the element whose z-index needs to be set.
It is the value specified in opts.node when setFloating_
is called. If not specified, it is the same as Widget.$n.
the z-index of a floating widget. It is called by setTopmost to decide the topmost z-index, and called only if setFloating_ is ever called.
the identifier of this widget, or null if not assigned. It is the same as id.
Optional getthe DOM element to match the widget.
the widget associated with the given node element. It is used by replaceHTML and replaceChildHTML_ to retrieve the widget associated with the note.
It is similar to Widget.$ but it gives the widget a chance to handle extreme cases. For example, Treeitem doesn't associate a DOM element (or you can say Treeitem and Treerow shares the same DOM element), so `zk.Widget.$(n)` will return Treerow, not Treeitem. If it is the case, you can override it to make replaceHTML works correctly.
5.0.3
the ID of the popup (zul.wgt.Popup) that should appear when the user clicks on the element.
null (no popup).
the DOM element that is used to hold the text, or null if this widget doesn't show any text.
return null (no text node).
<p>For example, {@link updateDomStyle_} will change the style
of the text node, if any, to make sure the text is displayed correctly.
<p>See also <a href="http://books.zkoss.org/wiki/ZK_Client-side_Reference/Component_Development/Client-side/Text_Styles_and_Inner_Tags">ZK Client-side Reference: Text Styles and Inner Tags</a>.
the ID of the popup (zul.wgt.Popup) that should be used as a tooltip window when the mouse hovers over the element for a moment. The tooltip will automatically disappear when the mouse is moved away.
null (no tooltip).
A widget call this function of its ancestor if it wants to know whether its ancestor prefer ignore float up event of it self.
false.
6.0.0
Initializes the widget to make it draggable. It is called if getDraggable is set (and bound).
You rarely need to override this method, unless you want to handle drag-and-drop differently.
use {@link zk.Draggable} to implement drag-and-drop,
and the handle to drag is the element returned by {@link getDragNode}
Inserts a child widget before the reference widget (the sibling argument).
the child widget
Optional sibling: Widget<HTMLElement>the sibling widget (the 'insert' point where the new widget will be placed before). If null or omitted, it is the same as appendChild
Optional ignoreDom: booleanwhether the widget was added successfully. It returns false if the child is always the last child (lastChild).
Inserts the HTML content generated by the specified child widget before the reference widget (the before argument). It is called by insertBefore and appendChild to handle the DOM tree.
Deriving classes might override this method to modify the HTML content, such as enclosing with TD.
Notice that when inserting the child (without the before argument), this method will call getCaveNode to find the location to place the DOM element of the child. More precisely, the node returned by getCaveNode is the parent DOM element of the child. The default implementation of getCaveNode is to look for a sub-node named uuid$cave. In other words, it tried to place the child inside the so-called cave sub-node, if any. Otherwise, Widget.$n is assumed.
the child widget to insert
Optional before: Widget<HTMLElement>the child widget as the reference to insert the new child before. If null, the HTML content will be appended as the last child. The implementation can use before.getFirstNode_() (getFirstNode_) to retrieve the DOM element
Optional desktop: Desktopwhether to automatically hide this component if a popup or dropdown is overlapped with it.
false.
If an iframe contains PDF or other non-HTML resource, it is possible that it obscues the popup that shall be shown above it. To resolve this, you have to specify autohide="true" to this component, and specify the following in the page: ```html
The JasperReport component. It is used to generate a Jasper report into an inline frame.
Available in ZK PE and EE