Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I want to manipulate the columns of an external list view (XsltListViewWebPart), however, as the data loads asynchronously I must wait for the data to load and the table to be generated before my code can run.

I assume I need to use a callback but can't find anything.

share|improve this question
    
Is this 2010 or 2013? For 2013, using JSLink could be an awesome option for you –  Robert Lindgren Jun 20 '13 at 7:41
    
2010. I ended up just polling for the existence of the table with class ms-listviewtable. –  Chloraphil Jun 20 '13 at 13:27

1 Answer 1

up vote 0 down vote accepted

I ended up just polling for the existence of the table containing the data, which will have class ms-listviewtable. (I'm using jQuery here.)

$(function(){
    var intervalId = setInterval(function() {
        if ($('.ms-listviewtable').length > 0) {
            clearInterval(intervalId);
            // Code here
        }
    }, 100);
});
share|improve this answer

Your Answer

 
discard

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.