Taking a shot in the dark...I know this is an old, unsupported version and control but I am so close to getting this huge application working in Google Chrome I just have to give it a shot. So right now the app works fine in IE but some nodes do NOT trigger a load event in Google Chrome; I dug into the JS files and I think I have a fix but no matter what I change, nothing changes. So I think this version uses the web resources and therefore the scripts are compiled in the DLLs right? So that is a dead end. BUT is there a way to disable the web resources or just point the app or the control to a script directory or a new ig_webtree.js file? I hope so.
Can anyone help?
Hi Peter,
You are right about it - scripts are compiled in the DLLs first, so you cant just replace the file.
However, you can benefit from Javascript prototype chain and override the methods that you need to. Let's say you need to rewrite the function doSomething from the ig_webtree.js file and put it in a myFix.js file:function myFix() { $IG.WebDataTree.prototype.__doSomething = function () { // your code }}
Then add your "patch" when the page loads, and call the function on body load event:
<head runat="server"> <script type="text/javascript" src="myFix.js"></script></head><body onload="myFix()">
When the problematic functions are about to be called, the functions from your file will be executed, instead of the code in the ig_webtree.js, which cannot be modified otherwise.
Please let me know if you have further questions on the matter, I will be glad to help.
Tried this but not working. I need to get this webtree control working in Chrome and I think it is because the get element function looks for igTxt but chrome is case sensitive and actually is igtxt so doesn’t find the element. I tried overriding that JS function but doesn’t work. Any help appreciated.
Just add it, I removed it by coincidence
I think I see my syntax error...let me fix and retry
Anyhow you declare a function with the same name AFTER the original, should work. Example:
<!DOCTYPE html> <html> <head runat="server"> </head> <body> </body> <script> function ig_getNodeTextElement(node) { // code } </script> </html>
Ok so I think, judging by this error, that my override function is being called...I can't thank you enough for helping me get to this point...but things are still not working...I still get the original error:
Uncaught TypeError: node.element.childNodes[i].getAttribute is not a function at ig_getNodeTextElement (VM54 myFix.js:12) at igtree_initNode.igtree_getText (VM61 WebResource.axd:2486) at NodeClick (Menu.aspx:73) at eval (eval at igtree_fireEvent (VM61 WebResource.axd:2782), <anonymous>:1:1) at igtree_fireEvent (VM61 WebResource.axd:2782) at igtree_navigate (VM61 WebResource.axd:1512) at igtree_nodeclick (VM61 WebResource.axd:1592) at HTMLDivElement.onclick (Menu.aspx:183)
I am glad that you managed to achieve your requirement.
Thank you for choosing Infragistics!
Yes...this seems to be working...awesome...thanks for your help.
Exactly, this sounds like the way to go. Do not hesitate to contact us at any time if any issue occurs or just to let us know if this worked in the end.
So instead of continuously fixing each function I may or may not discover not working, I went ahead and copied the entire file and tweaked all instances of the case sensitivity issue and am overwriting all the functions...so far this seems to be working...will continue testing. I can't thank you enough for your help.
Hi,
Check what is passed as node in the function arguments, check node.element.childNodes, compare it with a browser where this is working to see whats the difference. Keep us posted on the progress