Welcome Guest Search | Active Topics | Sign In | Register

TreeView Contextmenu Item click Options
Bhartha
Posted: Thursday, April 4, 2013 6:06:04 PM
Rank: Member
Groups: Member

Joined: 4/4/2013
Posts: 10
Hi,

I have a Treeview, and have a context menu on it which is working. I need to now get the event working when the user clicks on the menu item. For that I have a
OnClickScript ="MenuItemClickHandler" in the menuitem. Which is not firing. The context menu has new node, edit and delete options. So any help in the lines of menu item click, getting a handle on the treeview node, any tricks would be greatly appreciated,

thanks,
Bhartha
eo_support
Posted: Friday, April 5, 2013 8:42:45 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,195
Hi,

OnClickScript does not take a function name. It takes full JavaScript code such as "alert('clicked')". ClientSideOnClick takes function name.

Thanks!
Bhartha
Posted: Friday, April 5, 2013 12:02:51 PM
Rank: Member
Groups: Member

Joined: 4/4/2013
Posts: 10
Hi,

<eo:MenuItem Text-Html="Rule" ClientSideOnClick ="MenuItemClickHandler"></eo:MenuItem>

I get an error. So, what I tried was, have a event fire from the ContextMenu,
<eo:ContextMenu ID="ContextMenu1" runat="server" ControlSkinID="None" SubMenuIconUrl="Blank" Width="120px" RaisesServerEvent="True" OnItemClick ="trvMenuItems_OnItemClick">

If the above (contextmenu event firing) is the direction I take, How can I get a handle on the node on the treeview.

Store the node from the ShowContextMenu(e, treeview, node)? Like an hiddenfield, example: <asp:HiddenField ID ="nodeID" runat ="server" />?

I do not mind the server side, but now, need to manipulate the treenode on which the context menu was shown. So, I my questions

1: How do I get a handle on the node on which the context menu was shown? (see above my doubts)
2: How can I read the position of the node in the tree?
3: How can I add the tree at a particular spot in the tree?

Thank you for the quick reply,
if you can answer me the above 3 questions, that would be awesome.
Thanks,
Bhartha
Bhartha
Posted: Monday, April 8, 2013 1:17:26 PM
Rank: Member
Groups: Member

Joined: 4/4/2013
Posts: 10
Can someone please help?

Thanks,
Bharath
eo_support
Posted: Monday, April 8, 2013 1:31:45 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,195
Hi,

If you do it on the server side, you will get all those information from this property:

http://www.essentialobjects.com/doc/1/eo.web.treeview.contextnode.aspx

If you do it on the client side, you need to handle ClientSideOnClick on the menu, not on the menu item:

http://www.essentialobjects.com/doc/1/eo.web.basenavigator.clientsideonitemclick.aspx

And more information here:

http://www.essentialobjects.com/doc/1/menucommon/handlingevent/client_event.aspx

Thanks!
Bhartha
Posted: Monday, April 8, 2013 4:11:59 PM
Rank: Member
Groups: Member

Joined: 4/4/2013
Posts: 10
Thanks, that worked!

You are been very quick to answer to my questions, and have been great. Thanks once again.

Bharath
eo_support
Posted: Monday, April 8, 2013 4:28:42 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,195
Glad to hear that! Please feel free to let us know if there is anything else.
Bhartha
Posted: Wednesday, April 10, 2013 2:31:20 PM
Rank: Member
Groups: Member

Joined: 4/4/2013
Posts: 10
Everything working fine so far. No issues on this subject. have a Dialog box pop up yesterday with the required fields. Now, I have added a few buttons to this dialog, and presently wiring some button click events on the server side. No problems so far. Thanks a plenty. Awesome Job you guys.


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.