tablesorter + AJAX
|
View:
New views
3 Messages
—
Rating Filter:
Alert me
|
|
|
tablesorter + AJAXHey there,
I've read through several AJAX+tablesorter posts and am still a little confuzzled on this. I am loading an entire table into a div like so: <div id="mainContent"> <p>Loading...</p> </div> <script type="text/javascript"> $(document).ready( function() { $.get('/ajaxRates',{}, function(data) { $('#mainContent').html(data); $('#ratesTable').tablesorter(); }); }); </script> The /ajaxRates URL returns the HTML table. I place it into the div using the function right after it. I then call that new table and apply tablesorter() to it. If I do this to an inplace table, it works fine. It's just the AJAX table I'm having trouble with. The new table should be fully in the DOM by the time that function returns correct? Is there some other event I need to wait for or attach somehow in order to get this to work correctly? Thanks Sumit Khanna http://penguindreams.org |
|
|
Re: tablesorter + AJAXtry:
$('#mainContent').html(data).find('#ratesTable').tablesorter(); On Mon, Nov 9, 2009 at 20:38, sumdog <sum.notify@...> wrote:
|
|
|
Re: tablesorter + AJAXNevermind. My original approach worked. I had just forgotten to use th tags instead of td tags in the thead section of the table in my AJAX call. Silly mistake.
|
| Free embeddable forum powered by Nabble | Forum Help |