Mailing List


Active Directory Products
Object Compare
Permission Compare

IPhone Products
Calls To Calendar
SMS To Gmail
Voicemail To Gmail

How Long For Me


NerdyHearn - Blog

<< Back To All Blogs

Using Ext JS in SharePoint... a tip

Friday, September 26th, 2008

Continuing with my SharePoint fun with JavaScript, I have been using Ext JS embedded into SharePoint for some development lately, and was continually receiving the error "Ext is undefined" while trying to load the generic, always-used, Ext.onReady function, such as follows:

... my perfect code here ...

It turns out that the problem is caused by SharePoint yet again mangling the things that normally work perfectly, and as-expected. SharePoint manipulates the script tags on the page (for whatever reason is beyond me) which in turn effects the loading order of these scripts. I was receiving the "Ext is undefined" message because of exactly that, Ext, at that time, was still undefined.

The only way that I could find to get around this for the time being, until myself or someone else finds a better way, was to wrap the Ext code in the generic body.onLoad event, such as follows:

document.body.onload = function() {
... my not so perfect code here ...

Hopefully this will once again save someone a SharePoint JavaScript head ache, as it definitely caused one for myself.

JavaScript SharePoint Skeptical Tom Out.


SharePoint JavaScript

Related Blogs

Adding Custom Menu Item to MOSS/WSS List Actions Menu
Fixing MOSS/WSS SharePoint errors with Alternate Access Mappings
Resolving "The application failed to initialize properly (0xc000007b)" in MOSS 2007
Receiving "The specified file is not a valid spreadsheet or contains no data" when importing to Office 365
Adding a Custom ASP.NET Page to MOSS/WSS


Tom said on Thursday, June 18th, 2009 @ 10:30 AM

Hi Henry,
Glad to hear it helped, this was one that drove me crazy for a while, so I feel your pain!

Henry said on Thursday, June 18th, 2009 @ 10:06 AM

I was having this very same issue. I had the suspicion that somehow Sharepoint is messing with the script since it had worked perfectly fine outside of Sharepoint. Thanks for info!

Add A Comment



Email Address: (not public, used to send notifications on further comments)


Enter the text above, except for the 1st and last character:

NerdyHearn - Latest tech news relating to C#, ASP.NET, SharePoint, PHP, general development, and more. SaveMySerials - Protect yourself from theft, fire, natural disasters and more by recording your serial numbers