Revision history [back]

click to hide/show revision 1
initial version

asked 2014-07-15 14:53:06 +0800

acostache gravatar image acostache

How to capture the Browser Window Resize/Size Event

Hi,

I have been looking into how to caputure the browser window's resize event, i.e. do this simple piece of code in ZK.

$(window).resize(function(){ zk.Widget.$('myuuid').listenerFunction(); //a widget of type X's function });

I have tried the following: - in the client code, add this code in a script, in a widget package (of my uuid) - in the client code, add this code inside the widget X (bind_) - on the server code, calling the code using Clients.evalJavaScript.

But i would really like to have this code on the client (js code), not using a ZUL page.

I have read about the "client activity watches", have seen fiddles on "(zk) window resize" (or even the browser window resize..), but they do not work or fit my constraint above.

Can you please indicate if this is possible at all in ZK? I suspect it should be as simple as adding that piece of jquery code somewhere, but maybe I am missing the spot.

Thanks in advance, Andrei

click to hide/show revision 2
sample code correction

How to capture the Browser Window Resize/Size Event

Hi,

I have been looking into how to caputure the browser window's resize event, i.e. do this simple piece of code in ZK.

$(window).resize(function(){ zk.Widget.$('myuuid').listenerFunction(); //a /a widget of type X's function function/ });

I have tried the following: - in the client code, add this code in a script, in a widget package (of my uuid) - in the client code, add this code inside the widget X (bind_) - on the server code, calling the code using Clients.evalJavaScript.

But i would really like to have this code on the client (js code), not using a ZUL page.

I have read about the "client activity watches", have seen fiddles on "(zk) window resize" (or even the browser window resize..), but they do not work or fit my constraint above.

Can you please indicate if this is possible at all in ZK? I suspect it should be as simple as adding that piece of jquery code somewhere, but maybe I am missing the spot.

Thanks in advance, Andrei

How to capture the Browser Window Resize/Size Event

Hi,

I have been looking into how to caputure the browser window's resize event, i.e. do this simple piece of code in ZK.

$(window).resize(function(){ zk.Widget.$('myuuid').listenerFunction(); /a widget of type X's function/ });

I have tried the following: - in the client code, add this code in a script, in a widget package (of my uuid) - in the client code, add this code inside the widget X (bind_) - on the server code, calling the code using Clients.evalJavaScript.

But My constraint: i would really like to have this code on the client (js code), not using a ZUL page.page. Also, I cannot simply add this to the script of my html page or in a window element, as my widget is a div inside my document body.

I have read about the "client activity watches", have seen fiddles on "(zk) window resize" (or even the browser window resize..), but they do not work or fit my constraint above.

Can you please indicate if this is possible at all in ZK? I suspect it should be as simple as adding that piece of jquery code somewhere, but maybe I am missing the spot.

Thanks in advance, Andrei

How to capture the Browser Window Resize/Size Event

Hi,

I have been looking into how to caputure the browser window's resize event, i.e. do this simple piece of code in ZK.

$(window).resize(function(){ zk.Widget.$('myuuid').listenerFunction(); //* a widget of type X's function/ function */ });

I have tried the following: - in the client code, add this code in a script, in a widget package (of my uuid) - in the client code, add this code inside the widget X (bind_) - on the server code, calling the code using Clients.evalJavaScript.

My constraint: i would really like to have this code on the client (js code), not using a ZUL page. Also, I cannot simply add this to the script of my html page or in a window element, as my widget is a div inside my document body.

I have read about the "client activity watches", have seen fiddles on "(zk) window resize" (or even the browser window resize..), but they do not work or fit my constraint above.

Can you please indicate if this is possible at all in ZK? I suspect it should be as simple as adding that piece of jquery code somewhere, but maybe I am missing the spot.

Thanks in advance, Andrei

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