Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
370
Microsoft JScript runtime error using UltraWelListbar 9.2.20092.2108
posted

I've just spent a day figuring out why my listbar was generating the following error (I can't log it as bug as my support contract has expired - please pass this on to the dev team):

'this.Group[...].HeaderAppearance' is null or is not an object

in the Infragistics listbar script (version 2.2.20042.1035) when iterating through the groups in the this._load = Function() and attempting to use:

this.Groups[i].HeaderAppearance.LeftCornerImage

The "i" is the group KEY instead of its index - so if, like me, you are using the key property to store the groups' unique database keys (which don't necessarily start at zero and do not necessarily increment in steps of one - eg "3", "4", "5", "16", "19"), then the error occurs.

The solution seems to be to add text in front of the numeric value (eg "ID_3") and then strip it back off again when you need to get the original value - because the key now contains characters, the javascript uses the index rather than the key property. 

Other workarounds would have been to use the "Tag" property or the "TargetUrl" property (with AutoNavigateSelectedItem set to false), but the tag property isn't available in javascript (why?), and the TargetUrl causes an attempt to redirect to a page even though it has been told not to auto navigate.

I hope this saves someone else some time and that the development team fix the "Key" bug, expose the apparently overlooked "Tag" property to javascript, and look into the AutoNavigateSelectedItem property.

Richard