Jump to content

Send window size to server


Rav

Recommended Posts

Hello,

I want to send the width of the form having AlignmentControl=uniAlignmentClient to the server but always receive various javascript errors. How to create a proper ajaxRequest? One of my bad tries:

function window.destroy(sender, eOpts)
{
    ajaxRequest(sender, 'WindowWidth', ['Width='+window.getWidth()] );
}
Link to comment
Share on other sites

A solution (maybe among others...) :

 

1. Don't use 'window.destroy' function (your ajaxRequest will never be thrown to the server), prefer 'window.hide'.

2. Set the "FreeOnClose" property of your Form to False.  By doing this, when you close your form, 'window.hide' is executed (otherwise, it won't).

3. replace 'window.getWidth()' by 'sender.getWidth()' in you ajaxRequest (which has to be written in 'window.hide' function) : ajaxRequest(sender, 'WindowWidth', ['Width='+sender.getWidth()] );

 

​Hope it will help!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...