I want to capture the MouseClick event in Java script on some ExplorerBarItems and bring up a context menu, but the ExplorerBar object does not expose this event. I capture the Click event, but I don't see any info in the ExplorerBarCancelEventArgs that gives me the mouse information. In looking at the eventArgs.getExplorerBarItem()._node._element.onmousedown, it looks like I should be able to capture it, but I don't know how to connect to that.
Basically, I am trying to capture information that used to be available on the 'Classic' ultrawebtree NodeClick event, but am being challenged in making it work on the new controls.
My items are all dynamically loaded via vb.net (2012) code, with each Group containing distinct information. I used to do this by having each group have it's own UserControl, but with the new controls I have lost that capability! I now add the WebExplorerItems to each dynamically created Group item, and would prefer to add the appropriate listener at that time.
I am using 2013.1 tools with .Net 4.5.
Thanks!
...Steve
Hello Steve,
I will be happy to assist you with your question.
You should be able to retrieve the mouse coordinates using the Window object as demonstrated in the code snippet below:
Please review the code snippet and let me know if you have any questions regarding my suggestion.
Jose,
I am not looking for the Mouse Coordinates!
Perhaps I'm looking at this wrong. I was thinking of adding the events to the ExplorerBarItem. Maybe I don't need to do that.
At a minimum, I need to know what mouse button was clicked on which ExplorerBarItem. I can get the ExplorerBarItem from the eventArgs. Can I get the Mouse buttons from window.event or someplace else???
Thanks...Steve
Mouse button code can be obtained from eventArgs.get_browserEvent.button in WebExplorerBar's ItemsClick client side event. Please refer the below code snippet.
Please let me know if you have any further questions regarding this matter.
I am attempting to follow what you told me to do on 2/11, but can't figure out how to call the methods you directed me to.
Please provide an example as to how I can prevent mouse event propagation.
Hi,
I am not sure if I understand you question, but I believe you are asking how you can retrieve the item that was clicked using the ItemClick event. This appears to have been answered by Prabha on Nov 8th. You can see in her code the variable "explorerbarItemText" and she obtains the text using "eventArgs.getExplorerBarItem().get_text();". If you use "eventArgs.getExplorerBarItem()", you will get the item that was clicked on the WebExplorerBar.
Please let me know if you have any questions regarding this matter.
So I see from this article that I should be able to call the preventDefault() or stopPropogation method to cancel the event.
But how do I retrieve the object to call from information passed to the ItemClick event?
Cancelling the WebExplorerbar's click events is not going to prevent the browser's event from firing. I recommend cancelling the browsers events instead.
To learn more about the mouse events for your browser, please review the following msdn article is the mouse events referenced at the bottom of the article:http://msdn.microsoft.com/en-us/library/ie/ff974344(v=vs.85).aspx
I'm back on this at last!
The above gives me the mouse button information.
However, when I process the right click, I can't seem to get the event to cancel default browser behavior. I have tried eventArgs.handled = true, eventArgs._cancel = true, and returning true or false from the event, but in each case the IE default right click actions occur.
How can I prevent the default browser right-click processing from occurring when I handle the event with my code?