Rav Posted June 6, 2016 Share Posted June 6, 2016 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()] ); } Quote Link to comment Share on other sites More sharing options...
ZigZig Posted June 6, 2016 Share Posted June 6, 2016 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! Quote Link to comment Share on other sites More sharing options...
Rav Posted June 7, 2016 Author Share Posted June 7, 2016 Thanks! That works perfect. I had no idea that such a simple request requires so deep knowledge of UniGui. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.