Order not right in Chrome or edge but right in FireFox
Order not right in Chrome or edge but right in FireFox
I have
$(document).ready(function () {
$(".DTable").dataTable({
"ordering": false
});
});
for version 1.9
My SQL is
SELECT P.BlogID, P.BlogTitle, P.CreatedDate, P.[Status], C.BlogCategoryName, MC.BlogMasterCategoryName FROM Blog P LEFT OUTER JOIN BlogCategory C ON C.BlogCategoryID = P.BlogCategoryID LEFT OUTER JOIN BlogMasterCategory MC ON MC.BlogMasterCategoryID = P.BlogMasterCategoryID WHERE 1 = 1 AND P.[BlogMasterCategoryID] = 3 order by MC.BlogMasterCategoryName, C.BlogCategoryName, P.CreatedDate desc
Which is the correct order but in Chrome it is showing in ascending BlogId order
The table is
<table border="0" class="DTable" width="100%" cellspacing="0" cellpadding="4">
<thead>
<tr>
<td bgcolor="#F2F2F2" width="29">
<a href="javascript: ConfirmDelete();" title="Delete Selected">
<img border="0" src="../../icons/DUSTBIN-SML.png" width="20" height="20"></a></td>
<td bgcolor="#F2F2F2">
<h2>Category</h2></td>
<td bgcolor="#F2F2F2">
<h2>Title</h2></td>
<td bgcolor="#F2F2F2" width="106">
<h2>Update</h2></td>
</tr>
</thead>
<tbody>
<%
Do Until rstBody.EOF %>
<tr>
<td width="29"><input type="checkbox" name="DeleteID" value="<%= rstBody.Fields("BlogID") %>"></td>
<td>
<h3>
<% Response.Write(Trim(rstBody.Fields("BlogMasterCategoryName"))) %>
<% If rstBody.Fields("BlogCategoryName") > "" Then
Response.Write " - " & trim(rstBody.Fields("BlogCategoryName"))
End If
%>
</h3>
</td>
<td>
<h3>
<a href="edit.asp?BlogID=<%= rstBody.Fields("BlogID") %>"><%= trim(rstBody.Fields("BlogTitle")) %></a></h3>
</td>
<td width="120">
<h3>
<select size="1" name="StatusLine<%= rstBody.Fields("BlogID") %>" id="Status<%= rstBody.Fields("BlogID") %>">
<option <%If rstBody.Fields("Status") = "Live" Then Response.Write "selected=""selected""" %> value="Live">Live</option>
<option <%If rstBody.Fields("Status") = "Hidden" Then Response.Write "selected=""selected""" %> value="Hidden">Hidden</option>
<option <%If rstBody.Fields("Status") = "Promo" Then Response.Write "selected=""selected""" %> value="Promo">Promo</option>
</select>
<input type="button" value="Go" name="StatusChanger" onclick="ChangeStatus(<%= rstBody.Fields("BlogID") %>)" style="font-size: 8pt"></h3></td>
</tr>
<%
rstBody.MoveNext
Loop %>
Answers
Are you really using DataTables 1.9? It was released in early 2012, and support for it has long expired. That said, if that is what you are using, then the issue is that it doesn't support
. DataTables 3 is just around the corner.
ordering: false. Instead usebSort: false. Legacy docs are here, but for real - updateAllan