I'm working with a group calendar on SP13, trying to show default resources on a standard, monthly calendar view.

I've followed the directions at this site but for some reason IE is throwing an error on SP.UI.ApplicationPages.CalendarSelector.instance().getSelector(1, $(el).attr('ctxid')) because the ctxid attribute has not been defined yet.

After looking into things, it appears that the ExecuteOrDelayUntilScriptLoaded for sp.ribbon.js is not actually waiting until sp.ribbon.js is finished loading.

While debugging, the getSelector call does eventually resolve to an object, but after the rest of my script runs, which makes it too late. Is there a better way to delay my script until sp.ribbon.js loads, or whatever it is that assigns the ctxid?


So... answered my own question.

I changed the script slightly to call setTimeout for 1 second to delay the script just long enough for sp.ribbon.js to finish loading.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.