Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6088047
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:56:25+00:00 2026-05-23T11:56:25+00:00

I have an strange behavior, which looks lika an problem with (a)synchronous method calls?!?

  • 0

I have an strange behavior, which looks lika an problem with (a)synchronous method calls?!?
I’m not sure!
An function receives data using getJSON, post process those data, add them to an table, which is sortable by the table-sorter plugin (http://tablesorter.com/).

Here some parts of the code. A function receives data by getJSON:

jQuery.getJSON(url,{},function(data)
              {
             success:{ ....

in the success block, the data will be processed in an for-each loop. during that for-each loop, every JSON element will be manipulated (doSomething()) an added to an HTML table:

success:{ [some-code]
          $.each (data.words, function (i,n) 
                              {result=doSomething(n);
                               obj=jQuery('#Template').clone().appendTo('#table');
                               obj.html(result);
                              }

finaly, after that for-each i have to update the Table-sorter -extension and start an new sorting:

         jQuery("#table").trigger("update");
         $("#table").trigger("sorton",[[[1,1]]]);
}; //end of "success

This code is simplified. The Problem is, that $("#table").trigger("sorton",[[[1,1]]]); only works correctly, if i start this function delayed setTimeout('$("#trends").trigger("sorton",[[[1,1]]]);',20);.

I think, that the output obj.html(result); will be asynchronous. So if i start the sorter-function without setTimeout, the sorter-function founds no data at runtime.

Is there a way to make that success block linear?

Thank you, for any kind of help!!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T11:56:25+00:00Added an answer on May 23, 2026 at 11:56 am

    If you look at the source for the tablesorter, the update event has a setTimeout in it, which is most likely what is affecting your call to sort the table.

    $this.bind("update", function () {
        var me = this;
        setTimeout(function () {
        // rebuild parsers.
            me.config.parsers = buildParserCache(
            me, $headers);
            // rebuild the cache map
            cache = buildCache(me);
        }, 1);
    

    A complete hack would be to add your sorting to the end of that block of code. A more elegant solution I’m not sure I can provide, but I wanted to share that finding with you.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In Ruby we have the 'bang' method capitalize! which has the strange behavior of
I'm getting a very strange behavior in MySQL, which looks like some kind of
I am having this strange behavior when performing a method which the if statement
I have not programmed C++ for a while and encountered a strange behavior when
I have a very strange problem, which took already several hours of my attention:
I have some strange behavior in my iphone app. I have an NSTimer which
I've discovered a strange behavior for mutable sets which I cannot understand: I have
SPListItem.GetFormattedValue seems to have a strange behavior for DateTime fields. It retrieves the DateTime
I have encountered a strange behavior while executing an sql query on the Oracle
I have a very strange behavior with Request.Form . Here are two IIS 7

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.