Show cool things you have done with our products


Post by prodda »

Hi

I have a third-party control that iterates upwards through a menu hierarchy using element id's to get an ascendant element. Their js goes like so;
while(!e.id)
{
  e = e.parentNode;
}
However, when Ext.QuickTips.init() is executed, many of these empty id's are given a value 'ext-genxxxx', where xxxx is a number. This breaks the third-party control's behaviour, because the while loop is exited too early.

Any idea why this is happening? I have a (pretty horrid) workaround, but I'm curious as to what's going on under the hood.

Post by mats »

Hmm, I wouldn't have expected the quicktips to 'touch' elements that it doesn't use. Could you post a simple test case with that 3rd party control (which one?).

Post by prodda »

It's an Infragistics.WebUI.UltraWebNavigator.UltraWebMenu (v11.1).

Quite simple to reproduce, just create yourself an UltraWebMenu with a few items in it;
<ig:UltraWebMenu ID="MyMenu1" runat="server" EnhancedRendering="true">
    <Items>
        <ignav:Item Text="Menu1" TagString="1" />
        <ignav:Item Text="Menu2" TagString="2" />
        <ignav:Item Text="Menu3" TagString="3" />
        <ignav:Item Text="Menu4" TagString="4" />
        <ignav:Item Text="Menu5" TagString="5" />
    </Items>
</ig:UltraWebMenu>
Note EnhancedRendering must be true to reproduce.

Then make sure you're initializing the QuickTips in your client-side script;
Ext.onReady(function () {
    Ext.QuickTips.init();
});
The problem is in the UltraWebMenu item's onmouseout event listener, so move the mouse pointer over the items and you should get an alert message saying "oMenu == null".

To get around this, I've removed Infragistic's event listener and added my own implementation which tests the id for "ext-gen" as well as empty (and also removes that darn stupid alert message!).

Post by mats »

Seems quite complex to install their trial. Too much work for now, I hope your workaround is ok :)

Post by prodda »

mats wrote:Seems quite complex to install their trial. Too much work for now, I hope your workaround is ok :)
No problem, my workaround was actually not OK for all instances, so I had to do this...

(function () {
    var native_alert = window.alert;
    window.alert = function () {
        if (arguments[0] !== 'oMenu == null') {
            native_alert(arguments[0]);
        }
    };
})();
...to stop their popup. Ouch. I wonder why they think a user is interested in the null-ness of oMenu :roll:.

Post Reply