Actions and Effects"
From Documentation
m |
|||
Line 4: | Line 4: | ||
Here we describe how to provide more effects for [[ZK Developer's Reference/UI Patterns/Actions and Effects|client-side actions]]. | Here we describe how to provide more effects for [[ZK Developer's Reference/UI Patterns/Actions and Effects|client-side actions]]. | ||
+ | |||
+ | The allowed effects are actually the names of methods defined in <javadoc directory="jsdoc">zk.eff.Actions</javadoc>. Thus, To add a new effect, you have to add a new method to it. For example, | ||
+ | |||
+ | <source lang="xml"> | ||
+ | zk.eff.Actions.fooIn = function (n, opts) { | ||
+ | //your own effect to make the node visible, such as | ||
+ | //zk(n).slideIn(this, opts); | ||
+ | }; | ||
+ | </source> | ||
+ | |||
+ | Then, you could use it in the client-side action: | ||
+ | |||
+ | <source lang="xml"> | ||
+ | <div action="fooIn"> | ||
+ | .... | ||
+ | </div> | ||
+ | </source> | ||
+ | |||
+ | The signature of an effect method is as follows. | ||
+ | |||
+ | function (<javadoc directory="jsdoc">_global_.DOMElement</javadoc> n, <javadoc directory="jsdoc">_global_.Map</javadoc> opts); | ||
+ | |||
+ | where <tt>n</tt> is the DOM element to apply the action, and <tt>opts</tt> is the options specified in the client-side action. | ||
=Version History= | =Version History= |
Revision as of 06:31, 27 December 2010
[since 5.0.6]
Here we describe how to provide more effects for client-side actions.
The allowed effects are actually the names of methods defined in Actions. Thus, To add a new effect, you have to add a new method to it. For example,
zk.eff.Actions.fooIn = function (n, opts) {
//your own effect to make the node visible, such as
//zk(n).slideIn(this, opts);
};
Then, you could use it in the client-side action:
<div action="fooIn">
....
</div>
The signature of an effect method is as follows.
function (DOMElement n, Map opts);
where n is the DOM element to apply the action, and opts is the options specified in the client-side action.
Version History
Version | Date | Content |
---|---|---|
5.0.6 | December 2010 | This feature was introduced in ZK 5.0.6 |