|
Rank: Member Groups: Member
Joined: 6/19/2009 Posts: 12
|
Hello, I am trying to create a login dialog that would come up under a menu item in the EO.Web.Menu control. I have an XMLDatasource that populates all the menu items. I would like to have the dialog open when the menu item is clicked or possibly hovered. Can this be accomplished?
Thanks!
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi, The key for this how to trigger JavaScript from the menu. You can either set each menu item's OnClickScript, or set the menu's ClientSideOnItemClick. If you chose to set ClientSideOnItemClick, then it would not have anything to do with XmlDataSource. See here for more information about how to handle ClientSideOnItemClick: http://doc.essentialobjects.com/library/1/clientapi_howto.aspxOnce you have that working, you would then call our client side API to display the dialog. It will be something like:
Code: JavaScript
eo_GetObject("Dialog1").show();
Hope this helps. Thanks
|
|
Rank: Member Groups: Member
Joined: 6/19/2009 Posts: 12
|
Ok, I did get it to work with the clientSideOnItemClick - in which I had to handle the navigation for all the other links in the menu but that was ok. I am now able to bring up the dialog with the click. However, I want to anchor that dialog under the login link on my menu. Can I use the Floater for that or is there a better way to fix that dialog right under the link?
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi, You won't need a Floater to do that. You can specify the dialog's ConfineElementID to confine the dialog inside a certain DTHML element: http://demo.essentialobjects.com/Default.aspx?path=Dialog\_i1\_i9This way the dialog will stay inside the element, so you can place the element at a fixed position in your page. If the position is dynamic, then it may be better for you to call this function directly: http://doc.essentialobjects.com/library/1/jsdoc.public.dialog.move.aspxHope this helps. Thanks
|
|
Rank: Member Groups: Member
Joined: 6/19/2009 Posts: 12
|
Great that seemed to work. One last question: I have moved the event from the click to the mouse over and use the eo_GetObject("LoginDialog").show() to display it, is there a simple method that would hide it on mouse out?
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
No. There isn't one. The core feature for a dialog is to block input behind the dialog when the dialog is visible, which means even if user tries to move mouse outside of the dialog (even click elements outside of the dialog), the dialog stays there and prevent user from interacting with those elements. So if you want the dialog to hide as soon as user moves mouse outside of the dialog, then you don't need a dialog at all. A simple absolute positioned DIV will be all you need.
Thanks
|
|