title: How to rerender data in a javascript table orderd by a specific column
body: <p>By javascript I generate rows for Agents in a table. every row represent an agent. after this I receive live data to update the columns. I have a column called (Calls) and i need to order the agents by calls (live update depending on received data) descending. example </p>
  
  <pre>
  agents ----- calls
  Sam ---------13
  Al  ---------12
  Sara---------8
  </pre>
  
  <p>if Sara got the most data by time then she'll be the first.</p>
  
  <pre>
  agents -------calls
  Sara----------15
  Sam ----------13
  Al------------12
  </pre>
  
  <p>and so on ..</p>
  
  <p>this is my row rendering </p>
  
  <pre><code>var $agentRow = '&lt;tr id="agentRow_' + agentId + '"&gt;&lt;th scope="row"&gt;' + agentName + '&lt;/th&gt;&lt;td class="calls" id="agentCalls_' + agentId + '"&gt;' + outTotalCalls +
              '&lt;/td&gt;&lt;td class="minutes" id="agentMinutes_' + agentId + '"&gt;' +
              outCallMinutes + '&lt;/td&gt;' +
              '&lt;td class="averages" id="agentAverage_' + agentId + '"&gt;' + averageOutCallTime + '&lt;/td&gt;&lt;/tr&gt;';
  
      //if $agentRow exists invoke setIncomingValuesToAgentsFields else append it to the table
      if ($('#agentRow_' + agentId).length) {
          setIncomingValuesToAgentsFields('#agentCalls_' + agentId, outTotalCalls);
          setIncomingValuesToAgentsFields('#agentMinutes_' + agentId, outCallMinutes);
          setIncomingValuesToAgentsFields('#agentAverage_' + agentId, averageOutCallTime);
      } else {
          $('#agentsTable').append($agentRow);
      }
  
  
  function setIncomingValuesToAgentsFields(elementId, inComingValue) {
      var currentElementValue = 0;
      if ($(elementId).text() !== "") {
          currentElementValue = $(elementId).text();
          currentElementValue = parseFloat(currentElementValue);
          currentElementValue += inComingValue;
          $(elementId).text(currentElementValue);
      } else {
          $(elementId).text(currentElementValue);
      }
  }
  </code></pre>