Hi,
I observed a strange behaviour when testing webdatamenu under Firefox 14.0.1, sometimes client itemclick won't fire.
After playing a bit with this behaviour it seems that, if the first time you click the item (let`s say Nodo1.1 in the sample), clicking on the item while moving the mouse, as if it were a tiny drag caused by the speed or hurry of the user. After that, item click won't fire. It does not seem to happen on IE. I know that it sounds strange but it is more normal than it seems.
I am using the last service release (12.1.20121.2048).
Any hints?
Sample:
<script> function nodeclick() { alert("click"); } </script>
<ig:WebDataMenu ID="WebDataMenu1" runat="server"> <ClientEvents ItemClick="nodeclick" /> <Items> <ig:DataMenuItem Text="Nodo1"> <Items> <ig:DataMenuItem Text="Nodo1.1"> </ig:DataMenuItem> </Items> </ig:DataMenuItem> </Items> </ig:WebDataMenu>
Thanks.
Hello rickycl,
This is caused by the browser. If you test this under different browsers you will observe the same behavior - when there is dragging with the mouse button down the click event is not fired. Maybe just the time for dragging required to cancel the click event is slightly different for each browser. However you could instead handle the mousedown event for all node elements, for example using jQuery:
$('#WebDataMenu1 li').mousedown(function () { alert("click");});
Let me know if this helps.
I understand what you say but what I observed is that after there is a "drag" over a datamenu item when you try clicking again, without moving the mouse this time, itemclick doesn't fire.