I am using an old version of UltraWebGrid by Infragistics and need to replace some of the built in javascript. The compiled js looks like its adding a bunch of functions to an object type as an api of sorts. formatted like:
var igtbl_ptsBand = ["functionname1",function(){...},"functionname2",function(){...},...
and so on. How would I override this?
Basically the control is adding html to the page in a way that is not compatible with newer browsers and the javascript code that does this just needs a little tweak. I found the code… I just need to change it.
The code can be found here
I added an answer to dump code examples in and whatnot. I will not select this answer
The array you mentioned seems to be a function table of sorts:
I would recommend using chaining instead of just an override. With chaining you can inject your own code, but still call the original function. Let’s say you want to replace “func2” and chain. You could do something like this:
origFunc may have arguments, of course, and you may want to use the JavaScript call() function to set the “this pointer” to something specific, e.g.:
If the arguments are in an array, you can use apply() instead of call().