Using version 9.2.20092.2025 (also tested in 8.2) and FireFox 3.6
Anytime I try to sort or basically anything with JavaScript I get the error:
Error: document.getBoxObjectFor is not a function
And the section in the source file looks like this:
else if (ig_csom.IsFireFox && document.getBoxObjectFor(elem)) { var rect = document.getBoxObjectFor(elem); r.x = rect.x; r.y = rect.y; r.w = rect.width; r.h = rect.height; }
Can anyone else confirm this?
Basically the grid is completely broken in this new version of FireFox.
Looks like the Infragistics grid was using a deprecated function. For a quick fix, add the following snippet to your page(s) or a javascript file (i'll probably extend it later to behave exactly like the missing function):
if (!document.getBoxObjectFor) { document.getBoxObjectFor = function(el) { var b = el.getBoundingClientRect(); return { x: b.left, y: b.top, width: b.width, height: b.height }; }; }
Ok, here's the improved version of the document.getBoxObjectFor function:
if (!document.getBoxObjectFor) { document.getBoxObjectFor = function(el) { if (!(el instanceof HTMLElement)) { return; } //else: var b = el.getBoundingClientRect(), p = el, x = sx = b.left - el.offsetLeft, y = sy = b.top - el.offsetTop, w = window; while (!(p instanceof HTMLHtmlElement)) { sx += p.scrollLeft; sy += p.scrollTop; p = p.parentNode; } return { x: sx, y: sy, width: Math.round(b.width), height: Math.round(b.height), element: el, firstChild: el, lastChild: el, previousSibling: null, nextSibling: null, parentBox: el.parentNode, screenX: x + w.screenX + (w.outerWidth - w.innerWidth) / 2, screenY: y + w.screenY + (w.outerHeight - w.innerHeight) / 2 }; }; }
Although it's working reasonably well, it's not a perfect replacement. Namely, the screenX and screenY properties are only approximations, which isn't really a problem because it doesn't look like the IG controls are using them anywhere. Furthermore, it doesn't work if the element is not displayed, whereas the original function would always return the element's position as if it were visible. Shouldn't be a problem, either.
Please tell me if you encounter any problems with this.
This works for me except for cells with a custom editor (WebCurrencyEdit, WebDateChooser, and WebCombo). The cell navigation works great, but when the cell is edited the control is rendered outside of the grid.
Looks like an HTMLTableElement does count as an offsetParent for its cells, therefore one should not subtract the offsets like with position: relative. Come to think of it, i haven't tested the code with absolute positioning, either. For now, this here should work with custom editors:
if (!document.getBoxObjectFor) { document.getBoxObjectFor = function(el) { if (!(el instanceof HTMLElement)) { return; } //else: var b = el.getBoundingClientRect(), c = el.offsetParent instanceof HTMLTableElement, p = el, x = sx = b.left - (c ? 0 : el.offsetLeft), y = sy = b.top - (c ? 0 : el.offsetTop), w = window; while (!(p instanceof HTMLHtmlElement)) { sx += p.scrollLeft; sy += p.scrollTop; p = p.parentNode; } return { x: sx, y: sy, width: Math.round(b.width), height: Math.round(b.height), element: el, firstChild: el, lastChild: el, previousSibling: null, nextSibling: null, parentBox: el.parentNode, screenX: x + w.screenX + (w.outerWidth - w.innerWidth) / 2, screenY: y + w.screenY + (w.outerHeight - w.innerHeight) / 2 }; };}
Edit: I did some more tests with combinations of positioning/scrolling. The code is not fool-proof yet.
This is working for me:
if (!document.getBoxObjectFor) { document.getBoxObjectFor = function(el) { var pos = {};
pos.x = el.offsetLeft; pos.y = el.offsetTop; parent = el.offsetParent; if (parent != el) { while (parent) { pos.x += parent.offsetLeft; pos.y += parent.offsetTop; parent = parent.offsetParent; } } parent = el.offsetParent; while (parent && parent != document.body) { pos.x -= parent.scrollLeft; if (parent.tagName != 'TR') { pos.y -= parent.scrollTop; } parent = parent.offsetParent; }
return pos; }; }
will this fix the problem with Chrome and Safari,
when I upgraded to Firefox 3.6 the click event of the UltraWebGrid stopped working
but your workaround fixed the problem with Firefox..is Chrome and Safari has different solution ?
Thanks
Jason
Hello,
We have issued a Service Release for 8.2 which contains this fix for Firefox. Please visit the 'My Infragistics Keys and Downloads' page here: https://www.infragistics.com/Membership/Default.aspx?panel=Downloads and log in.
Download the latest Service Release for NetAdvantage for ASP.NET 2008 Volume 2. The build number ends in 2204.
We are using UltraWebGrid v8.2, along with some other Infragistics controls and attempting to employ the fix listed above (copying fixed js files to a different directory and pointing webConfig there), but the js files are spread throughout the folder structure. Do they all need to be copied to the same directory? If so, will the folder structure need to be preserved in this new directory?
Alternatively, is there any other workaround short of upgrading to v9.2?
Unfortunately Chrome is not supported by the UltraWebGrid.
Please take a look at the WebDataGrid.
I use Chrome 5.0.375.86 and the grid is displayed and loaded with rows..my problem is with events ..row changed event or click event is not working .
I just did a quick test with Chrome 6.0.447.0 dev and it seems that the whole grid doesn't work. No rows were loaded, the paging and total rows seems to be correct.