0

How to execute JS function after component is initialized (DOM + databind + ZK JS)?

asked 2010-03-18 19:51:50 +0800

madruga0315 gravatar image madruga0315 flag of Brazil
937 2 12

Hi,

My case is the following:

I have a grid with databind. After the grid is rendered, I want to call a JS function, that will iterate over the cells, do some processing, and update a label value. In my JS I get the reference of the widget with: zk.Widget.$('grid')

I'ts just a JS, I'm not creating a component neither extending a widget.

Is this possible somehow?

Thank you,
Madruga

delete flag offensive retag edit

2 Replies

Sort by ยป oldest newest

answered 2010-03-18 20:37:17 +0800

PeterKuo gravatar image PeterKuo
481 2

How about call Clients.evalJavaScript(command) in doAfterCompose()?
Please refer to
http://docs.zkoss.org/wiki/Applying_Input_Masks_With_JQuery

link publish delete flag offensive edit

answered 2010-03-18 21:50:49 +0800

madruga0315 gravatar image madruga0315 flag of Brazil
937 2 12

Hi Peter,

That didn't work.

What worked for me was using jq().ready() in my JS, like this:

jq(document).ready(function(){
    calculateTotalFooter(true);
});

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: 2010-03-18 19:51:50 +0800

Seen: 453 times

Last updated: Mar 18 '10

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