Larsi
Larsi

Reputation: 4774

jQuery - hook into a ajax response?

I've got a webpart that shows a table. This webpart refreshes itself every 15 sec via some ajax POST (from what I see in firebug). I've got no control over this webpart. (SharePoint native)

I'm building some live filtering using jQuery to filter table rows in the webpart. On a button click I'm calling a function that hides all rows that does'nt match the filter criteria.

Question is: How can I rerun my filtering function after the webpart has been updated?

(in the filtering algorithm involves some logic, so I don't think I can get around with a selector that does it.)

Larsi

Upvotes: 2

Views: 2216

Answers (1)

Larsi
Larsi

Reputation: 4774

In case of asp.net and an updatepanel one can use the pageLoad function to hook up with some code. To just add a handler to the pageLoad the following code works:

Sys.Application.add_load(initSomething);
function initSomething() {
    alert("The ajax call was completed");
}

(found in this question: Rebinding events in jQuery after Ajax update (updatepanel) )

Larsi

Upvotes: 1

Related Questions