I guess this was not added to the CSOM. Anyone had any luck implementing something that can tell when the mouse is hovering over a node? I need to trigger a javascript function when a user hovers on a node.
Hi.
I required the same functionality and was able to successfully wire up the event.
1. Copy the ig_webtree.js file from the scripts directory where you installed infragistics into your project folder. (located maybe in C:\Program Files\Infragistics\NetADVantageversionX\ASP.NET\Scripts)
2. Set the JavascriptFilename property on the tree to the file you've copied.
3.Modify the copied Javascript file.
- Look for the following functions within:
function igtree_mouseover(evnt,tn) which in my version was on line 1089. At the end of the function there is an if statement if(igtxt!=null && igtxt.length>0) { ... somewhere inside that if statement, write a call to a new function. e.g. MyMouseOverFunction(tn,eNode.id) and then create this function in your own javascript files.
then you've got your event!
If you also want the Mouse Out event. The next function in the ig_webtree should be called function igtree_mouseout(evnt,tn). look for the if statement near the end of the function like: if(src.hoverSet) { and put your function in there MyMouseOutFunction(tn,eNode.id)
hopefully this was helpful!
dtnixon -
This is exactly what I was looking for. As soon as I get it to work I will mark your post as the answer.
Thanks for taking the time to post.
Patrick
I started work moding their js file and so far I have added my function call in the place you suggested and see what's happening. I think I need to do something like the following in my function:
First I added :
this.NodeHover=events[25]; to
function igtree_events(events)
function MyMouseOverFunction(tn, id)
{
var tree=igtree_treeState[tn];
var node=igtree_getNodeById(id);
if(node == null || !node.getEnabled())
return;
var oEvent = igtree_fireEvent1(tree,tree.Events.NodeHover,node,ig_dataTransfer,evnt);
}
I have tree, and I've added the event to the event collection(NodeHover), I have the node retrieved by the id sent into my function. What I don't have is ig_dataTransefer and evnt. Am I on the right track? Any suggestions about the missing objects?
Thanks,
I didn't do any of that adding to events etc.
I wanted to make my mod very simple, as each time infragistics upgrades, I have to reapply it to the new files. My modification to ig_treeweb.js was just the addition of the two lines which were the function calls.
Then i just had the actual function defined in a javascript file that is attached to the aspx page that the tree is actually on...Then you access the tree and node through the various igtree_getNodeById etc or igtree_getTreeById...
I can put a sample together if you like...
Forgive my ignorance. I see what you are doing. Let me try it out.