Sort HTML table data with two columns
<pre><code>Vector  VectorMode          VectorBaseDate
5       4                       2012-06-16
5       3                       2013-06-16
5       2                       2012-06-16
5       1                       2012-06-16
5       1                       2013-06-16
5       2                       2013-06-16
5       3                       2012-06-16
5       4                       2013-06-16
</code></pre>

<p>This is the html table I am creating by reading some xml file with an jquery ajax call. First I want to sort by date and then sort by mode. So the result should look like.</p>

<pre><code>Vector  VectorMode          VectorBaseDate
5       1                       2012-06-16
5       2                       2012-06-16
5       3                       2012-06-16
5       4                       2012-06-16
5       1                       2013-06-16
5       2                       2013-06-16
5       3                       2013-06-16
5       4                       2013-06-16
</code></pre>

<p>I tried table sorter plugin but no luck.</p>

<pre><code>$("table").tablesorter();
        $.ajax({
        type: "GET",
        url: "vector.xml",
        dataType: "xml",
        success: function(xml) {
                            $('#showVelocity').append('&lt;table cellspacing="1" id="myTable" class="tablesorter"&gt;');
                            $('#showVelocity').append('&lt;thead&gt;&lt;tr&gt;&lt;th&gt;VectorType&lt;/th&gt;&lt;th&gt;VectorMode&lt;/th&gt;&lt;th&gt;InitialValue&lt;/th&gt;&lt;th&gt;VectorBaseDate&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;');
                            $('#showVelocity').append('&lt;tbody&gt;');
                            $(xml).find('Vector').each(function() {
                            var intialVal = $(this).find('InitialValue').text();
                            var vectorBaseDate = $(this).find('VectorBaseDate').text();
                            var attrValType = $(this).find('VectorType').attr('tc');
                            var attrValMode = $(this).find('VectorMode').attr('tc');
                            if (attrValType=='5') {
                                //$('#someElement').append(intialVal+'&lt;br/&gt;');  
                                var tr = '&lt;tr&gt;&lt;td&gt;'+attrValType+'&lt;/td&gt;&lt;td&gt;'+attrValMode+'&lt;/td&gt;&lt;td&gt;'+intialVal+'&lt;/td&gt;&lt;td&gt;'+vectorBaseDate+'&lt;/td&gt;&lt;/tr&gt;';
                                $('#showVelocity').append(tr);
                            };

                            $('#showVelocity').append('&lt;/tbody&gt;&lt;/table&gt;');
                            $("table").trigger("update");
                            var sorting = [[1,0],[3,0]]; 
                            $("table").trigger("sorton",[sorting]);
                        }); 
                }
            });
</code></pre>
