SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have an external list that I want to hackup with jQuery. If i put a simple alert in document .ready, it fires, and THEN the SharePoint progress spinner shows up, and then the data is returned - long after document.ready. Has anyone been able to use jQuery to manipulate the results of a SharePoint external list? I hope that makes sense.

share|improve this question
The BCS data itself is being retrieved via Ajax / javascript, so it makes sence document.ready fires before the data is actually there. You could look into the way SharePoint loads this data and replicate it on a custom page of your own; that way you should be able to fire your custom functions after the data loads. Perhaps there's even a client side event to subscribe to, don't know though. – Jasper Jul 20 '12 at 10:06
Jasper, I looked high and low to find way to intercept that event, but was unsuccessful. If someone finds a way to do this, that would be a better solution that the one I proposed, which is clunky but at least works. – Derek Gusoff Jul 20 '12 at 14:33
up vote 0 down vote accepted

I ran into this problem as well. You have to do periodic polling of the DOM to detect when the content is loaded. What I implemented looked something like this:

 $().ready(function () {

function checkForDOMAndCalculate() {
setTimeout(checkDOM, 100);

function checkDOM() {
displayValueIndex = $(" th             a:contains('DisplayValue')").closest("th").index();
approvalStatusIndex = $(" th  a:contains('ApprovalStatus')").closest("th").index();

if (displayValueIndex == undefined || displayValueIndex == -1) {

else {

Here's what the code does: it delays for 1/10 of a second, looks for a particular value in the DOM using jQuery, and if it finds it, proceeds with the calculations. If it doesn't find it, it waits another 1/10 second and tries again. It repeats this until it finds the DOM has loaded.

The key to this is the setTimeout() function, which executes the delay and then the code.

share|improve this answer
Nice. That was what I was looking for. Works perfectly. – Jeffrey B. Murphy Feb 19 '13 at 22:56

I would recommend you to check the SPServices, it is Client Object Model ... check msdn for that. I think with that you can manipulate the data on the client side and then probably pass to your own JQuery functions etc ...

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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