iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
Where or how do I set the Height of a WebDialog (modal) in the code behind.
Currently, I try to assign myDialogBox.Height = "100%", but it is marked as type "Pixel" and will not accept the % symbol.
If I try to change the type for Height, I receive an error "Expression is a value and therefore cannot be the target of an assignment".
myDialogBox.Height.Type = UnitType.Percentage
// Function for set the size in percentage and // set the WebDiaolog to in the center of the web page function size() { var dlg = ISGetObject("WebDialogBox1"); // variable to set the "%" value var percent = 90; var percent2 = percent / 100; dlg.Window.GetWindowDivElement().style.height = percent + "%"; dlg.Window.GetWindowDivElement().style.width = percent + "%"; var body = document.body; var html = document.documentElement; // variable to get the web page's Height var height = Math.max(body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight); // variable to get the web page's Width var width = Math.max(body.scrollWidth, body.offsetWidth, html.clientWidth, html.scrollWidth, html.offsetWidth); // variable to get the new WebDialogBox's position var new_offsetTop = (height - (height * percent2)) / 2; var new_offsetLeft = (width - (width * percent2)) / 2; // set the new WebDialog's position // so the WebDialog will be in the center of the web page dlg.Window.GetWindowDivElement().style.posTop = new_offsetTop; dlg.Window.GetWindowDivElement().style.posLeft = new_offsetLeft; } // This function called when WebDialogBox created function OnCreatedWD() { // Delay before set the height and width in percentage window.setTimeout(function () { size(); }, 10); }
Hope this script can resolve your problem. Thank you.
Regards,
Hans.
Hello,
Thank you for your report. Unfortunately, this is not a bug in our WebDialogBox. The “%” value would be set back as pixel as design. Our WebDialogBox is not designed to set its size in percent because it already has its own mechanism and reason. Example, WebDialog is set in middle position. If user can dynamically set its size in %, the position and design would be a little weird. Perhaps, you can also let us know why you need to set in %.
But it does not mean that you cannot set its size in %. To do that, you could use WebDialodBox’s OnCreated() client side. Let me show you the example script how to set the size in %.
// Function for set the height and width in percentage function size() { var dlg = ISGetObject("WebDialogBox1"); dlg.Window.GetWindowDivElement().style.height = "100%"; dlg.Window.GetWindowDivElement().style.width = "100%"; } // This function called when WebDialogBox created function OnCreatedWD() { // Delay before set the height and width in percentage window.setTimeout(function () { size(); }, 10); }
Hope this helps. Thank you.
I have attempted to use a modal WebDialog with height set to 720px. Sometimes, the user has a screen resolution where the bottom of the box is off the screen (the action buttons are off the screen). When this box is moved up to where the buttons are visible, the "modal" graphic is not always removed when it is closed. This makes the page/controls that were "under" the modal box unusable.
I was hoping to set a percentage of the screen or a minimum height so the buttons would always be visible.
Where can I find documentation regarding the events and properties for your products?
I am interested in more things like "dlg.Window.GetWindowDivElement()" and the flow of events like "OnCreatedWD()". These could be helpful for the WebDialogBox and WebGrid.
Hello,You can find our documentation in Microsoft Help Viewer. In this case, let me show you, How to get WebDesktop documentation: Click Start -> All Programs -> Intersoft WebUI Studio 2011 R2 SP1 -> WebUI Studio for ASP.NET -> WebDesktop 3 -> WebDesktop 3 Documentation.You can choose what product documentation that you need. I attached a screenshot (documentation.jpg) in order to make you easier to find the documentation.Or you can download our documentation from our website and choose what product documentation that you need (http://intersoftpt.com/Support/).You can set or configure event like “OnCreatedWD()” in Client Side Events of the WedDialogBox. I also attached a screenshot (ClientSideEvents.jpg) in order to make you easier to understand.But unfortunately, our documentation doesn’t provide explanation about javascript code any further, like GetWindowDivElement(). You should find another resource or documentation about javascript code.Hope this helps. Thank you.Regards,Hans.
I downloaded the documentation and searched for "GetWindowDivElement". No topics exist. So, you don't have documentation on the javascript functions an methods available to your controls?
GetWindowDivElement() is not a standard javascript function; neither is OnCreatedWD().
Where would I find this other resource that documents your controls?
Thanks.
Hello,There isn’t explanation about javascript function or method like GetWindowDivElement() in our documentation indeed.If you want to know the existing method and property in WebDialogBox (or another control), you could use debugger method in your javascript function.Actually, to resolve your issue, I looked for the method and property in WebDialogBox that contain the height value of the WebDialogBox. Then changed it to “%” value.Or I can say, you should do research about the method and property in our control. So you can use the right method and property according to your needs.Hope this helps. But If there is any question or issue, please do not hesitate to ask us again. I would be happy to help you. Thank you.Regards,Hans.
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname