0

about zk 5 init event

asked 2009-09-08 08:28:03 +0800

mantuoluo gravatar image mantuoluo
132 1

i test my app in zk5 .
i want to init a component when the page is open.

i tried following method:
1)
$init: function () {
this.$supers('$init', arguments);
this.$afterInit(this._init);
},
_init: function () {
jq("#"+this.uuid).myfunction()....

}

in this case,jq(this.uuid) execute,but it get null when getelement in jquery.
i thinks the document don't init so i can't get it.

2)
$define: {
init_data:function (v){
jq("#"+this.uuid).myfunction()...

},

in this case ,get null when getelement in jquery again.


so, how can i init my widget in zk5.
thanks!

delete flag offensive retag edit

2 Replies

Sort by ยป oldest newest

answered 2009-09-12 02:42:40 +0800

mantuoluo gravatar image mantuoluo
132 1

anybody help me?
thanks!~

link publish delete flag offensive edit

answered 2009-09-21 01:59:51 +0800

henrichen gravatar image henrichen
3869 2
ZK Team

$init() works in ZK's JavaScript widget like the constructor in Java. The DOM element is not "bound" to the JavaScript widget yet.

Take a look of the ZK5 documents on ZK website first.

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2009-09-08 08:28:03 +0800

Seen: 250 times

Last updated: Sep 21 '09

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More