Rest
..._rest: any[]The 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)
Static
$oidStatic
nonAn instance of zk.Skipper that can be used to skip the rerendering of child widgets except the caption.
It assumes
In other words, it detaches (i.e., skipped) all DOM elements under widget.$n('cave'). ```ts setClosable: function (closable) { if (this._closable != closable) { this._closable = closable; if (this.node) this.rerender(zk.Skipper.nonCaptionSkipper); } } ```
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
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.
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
Proxies a member function such that it can be called with this object in a context that this object is not available. It sounds a bit strange at beginning but useful when passing a member of an object that will be executed as a global function.
Example: Let us say if you want a member function to be called periodically, you can do as follows. ```ts setInterval(wgt.proxy(wgt.doIt), 1000); //assume doIt is a member function of wgt ```
With proxy, when doIt is called, this references to wgt. On the other hand, the following won't work since this doesn't reference to wgt, when doIt is called. ```ts setInterval(wgt.doIt, 1000); //WRONG! doIt will not be called with wgt ```
Notice that this method caches the result so that it will return the same proxied function, if you pass the same function again.
a function that can be called as a global function
(that actually have this
referencing to this object).
Restores the DOM elements that are detached (i.e., skipped) by skip.
the widget being re-rendered
Skips all or subset of the descendant (child) widgets of the specified widget.
Notice that the `skipId` argument is not used by zk.Widget#rerender. Rather it is used to simplify the overriding of this method, such that the deriving class can call back this class and to pass a different ID to skip
If you don't want to pass a different ID (default: uuid + '-cave'), you can ignore `skipId` ```ts Object skip(zk.Widget wgt); ```
it detaches all DOM elements whose parent element is
jq(skipId || (wgt.uuid + '-cave'), zk)
.
whether the specified child widget will be skipped by skip.
returns if wgt.caption != child. In other words, it skip all children except the caption.
Static
isDetermines if the class by this Class object is either the same as, or is a superclass of, the class represented by the specified Class parameter. Example:
if (klass1.isAssignableFrom(klass2)) {
}
the Class object to be checked, such as zk.Widget.
true if assignable
Static
isDetermines if the specified Object is assignment-compatible with this Class. This method is equivalent to [[zk.Object#$instanceof]. Example:
if (klass.isInstance(obj)) {
}
the object to check
true if the object is an instance
A skipper is an object working with zk.Widget#rerender to rerender portion(s) of a widget (rather than the whole widget). It can improve the performance a lot if it can skip a lot of portions, such as a lot of child widgets.
The skipper decides what to skip (i.e., not to rerender), detach the skipped portion(s), and attach them back after rerendering. Thus, the skipped portion won't be rerendered, nor unbound/bound.
The skipper has to implement three methods, skipped, skip and restore. skipped is used to test whether a child widget shall be skipped. skip and restore works together to detach and attach the skipped portions from the DOM tree. Here is how zk.Widget#rerender uses these two methods: ```ts rerender: function (skipper) { var skipInfo; if (skipper) skipInfo = skipper.skip(this);
this.replaceHTML(this.node, null, skipper);
if (skipInfo) skipper.restore(this, skipInfo); }
See also ZK Client-side Reference: Property Rendering.