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
WebGrid 10 - WebMenu when MenuWindowType = "Popup" in document with a lot of stylesheets causes major performance issue in WebMenuEngine.GetCssStyleString
Using WebGrid 10 with IE 11, I have code in the OnRowContextMenuclient side event handler that checks if the windows width is too small (grid within a narrow iframe (~ 350 pixels)), and if so, switches the context menu’s object to use a Popup instead so it can pop over the iframes boundaries:
oMenu.MenuWindowType = "Popup";oMenu.MenuStyleSettings.MenuWindowType = "Popup";
This approach has been working since 2010 but has created a new problem in WebGrid 10 I believe due to the changes with using the UseCssFramework in the WebGrid/WebMenu.
My document has 12 stylesheets including bootstrap, jqueryUI, etc. One stylesheet has 14723 rules in it. When the context menu is about to be shown, IE/JavaScript spends a long time in the WebMenu component, in what appears to be the WebMenuEngine.GetCssStyleString trying to find the desired rules to customize the menu look. I am using the Bootstrap ISNet theme too.
When it freezes IE, IE gives a “<host> is not responding due to a long running script”.
How can I resolve this?
Thanks,
Mike
... This approach has been working since 2010 but has created a new problem in WebGrid 10 I believe due to the changes with using the UseCssFramework in the WebGrid/WebMenu. ...
Basically, the Popup MenuWindowType is created using window.createPopup() method. This MenuWindowType will allow components that used WebMenu Engine such as WebContextMenu, WebMenuBar, WebToolBar, WebDesktopManager and WebNotification will have its window displayed in a special "popup" type when running in Internet Explorer browser.
The main advantage of the "popup" window type is its ability to display its content out of the browser's window boundary. However, Internet Explorer 7.0 has removed this function from "popup" object and introduced limited positioning by design. *For more detail, please check createPopup method page in here.
To overcome this limitation, it is recommended to use the new Normal option for MenuWindowType. This new WindowType solves numerous display and positioning issues that occurred in Internet Explorer 7.0 (and newer). Note that these issues are behavior by design in Internet Explorer 7.0 (and newer) which limits the usage of "popup" object to prevent security issues.
By default, we use MenuWindowType=Normal except when the IFRAME the grid is in is too narrow (less than 375px). When its too narrow, the WebGrid's context WebMenu doesn't display properly. That is why we worked around the issue using the Popup. You make a good point about that being IE specific though. The application is IE specific currently, but will be expanded to cross-browser soon too.
Anything we can do so the Normal MenuWindowType can display better with narrow browser windows/IFRAMEs?
You might want to try to set the WebGrid context menu position manually by using WebGrid OnRowContextMenu client-side event and invoking Show(x, y) method. Following snippet code shows how to show WebGrid context menu at 0px from left and 0px from top:
function WebGrid1_OnRowContextMenu(controlId, rowType, rowElement, menuObject) { var WebGrid1 = ISGetObject(controlId); // menuObject.Show(x, y); menuObject.Show(0, 0); return true; }
Hope this helps.
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