Mailing List



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

Deploying Reporting Services WebParts to SharePoint WSS and MOSS
Starting SharePoint workflow for each item in a list
SharePoint STSADM AddSolution Object Reference not set to an Instance of the Object error
Creating a dynamic SharePoint settings DropDown using a ToolPart


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