M undefined - sorttable.js when sorting by three columns

When I try to sort by three columns (state, status, and queue), I get a javascript error that says m is undefined (292 is out of range 32). I do not think this error comes from the sorttable.js file. He points me to the jquery.min.js file. I cannot understand why these three columns have problems, since the data inside them is pretty standard (just words, never empty). It seems to be just sorting by which column was successfully sorted successfully.

Here is the code:

The user clicks the Go button - sends an ajax request request to another page that fills the results.

function SubmitSearch() { $("#searchResults").html('<br/><center><img src="../Images/barberpole.gif" style="margin-top:3px;"></center>'); //Deleted all initializing code. There is no problem with this. $.ajax( { type: "POST", url: "../ajaxURLs/SearchRequests.aspx?requestID=" + requestID, cache: false, success: function (data) { $("#searchResults").html(data); sorttable.makeSortable(document.getElementById("SearchResults")); } }); } 

Table

 <asp:GridView ID="SearchResults" runat="server" AutoGenerateColumns="False" DataKeyNames="requestNumber" CSSClass="mailGrid" OnRowDataBound="SearchRedirect"> <Columns> <asp:BoundField DataField="requestNumber" HeaderText="Request Number" InsertVisible="False" ReadOnly="True" /> <asp:BoundField DataField="state" HeaderText="State" /> <asp:BoundField DataField="status" HeaderText="Status" /> <asp:BoundField DataField="queue" HeaderText="Queue" /> <asp:BoundField DataField="oem" HeaderText="OEM"/> <asp:BoundField DataField="rayMaterialNum" HeaderText="Material Number"/> <asp:BoundField DataField="mfgPartNumber" HeaderText="Mfg Part Number"/> <asp:BoundField DataField="program" HeaderText="Program"/> <asp:BoundField DataField="purchaseOrder" HeaderText="Purchase Order" /> <asp:BoundField DataField="purchReq" HeaderText="Purchase Requisition"/> <asp:BoundField DataField="businessUnit" HeaderText="Business Unit"/> <asp:BoundField DataField="site" HeaderText="Site"/> <asp:BoundField DataField="buyer" HeaderText="Buyer"/> <asp:BoundField DataField="requisitioner" HeaderText="Requisitioner"/> <asp:BoundField DataField="componentEngineer" HeaderText="Component Engineer"/> <asp:BoundField DataField="responsibleEngineer" HeaderText="Responsible Engineer"/> <asp:BoundField DataField="qualityEngineer" HeaderText="Quality Engineer"/> </Columns> </asp:GridView> 

I am using version 2 of sorttable.js, Firefox 13.0.1, jquery v1.7.2

Generated html:

 <table id="SearchResults" class="mailGrid" cellspacing="0" border="1" style="border-collapse:collapse;" rules="all"> <thead> <tr> <th class=" " scope="col">Request Number</th> <th class=" sorttable_sorted_reverse" scope="col"> <th class=" " scope="col">Status</th> <th class="" scope="col">Queue</th> <th class=" " scope="col">OEM</th> <th class=" " scope="col">Raytheon Material Number</th> <th class="" scope="col">Mfg Part Number</th> <th class="" scope="col">Program</th> <th class="" scope="col">Purchase Order</th> <th class="" scope="col">Purchase Requisition</th> <th class="" scope="col">Business Unit</th> <th class="" scope="col">Site</th> <th class="" scope="col">Buyer</th> <th class="" scope="col">Requisitioner</th> <th class="" scope="col">Component Engineer</th> <th class="" scope="col">Responsible Engineer</th> <th class="" scope="col">Quality Engineer</th> </tr> </thead> <tbody> <tr onclick="ViewRequest('2000')"> <tr onclick="ViewRequest('2001')"> <tr onclick="ViewRequest('2002')"> <tr onclick="ViewRequest('2003')"> <tr onclick="ViewRequest('2004')"> <tr onclick="ViewRequest('2005')"> <tr onclick="ViewRequest('2006')"> <tr onclick="ViewRequest('2007')"> <tr onclick="ViewRequest('2008')"> <tr onclick="ViewRequest('2009')"> <tr onclick="ViewRequest('2010')"> <tr onclick="ViewRequest('2011')"> <tr onclick="ViewRequest('2012')"> <tr onclick="ViewRequest('2013')"> <tr onclick="ViewRequest('2014')"> <tr onclick="ViewRequest('2015')"> <tr onclick="ViewRequest('2016')"> <tr onclick="ViewRequest('2017')"> </tbody> <tfoot></tfoot> </table> 

An example of one of tr. They all follow this format, and the corresponding columns will always have data.

 <tr onclick="ViewRequest('2000')"> <td>2000</td> <td>Open</td> <td>Initiated</td> <td>Buyer</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>0</td> <td>0</td> <td>0179450</td> <td>Pending</td> <td>Pending</td> <td>Pending</td> <td>Pending</td> </tr> 
+4
source share
1 answer

As far as I know, you should add class = "sortable" to any table you want to sort, maybe this can solve the problem.

+1
source

All Articles