Decimal Sorting Problem and Plugin Help

Decimal Sorting Problem and Plugin Help

marioangulomarioangulo Posts: 5Questions: 0Answers: 0
edited July 2011 in General
I have the following code done in asp the problem is it doesn't seem to want to sort the second column correctly which contains decimals. I read about using plugins to resolve this issue, but Im not a 100 percent on how to go about doing this for my code. Any help would be appreciated.

[code]


$(document).ready(function() {
$('#myTable').dataTable( {

"bJQueryUI": true,
"oLanguage": {
"sLengthMenu": 'Display '+
'10'+
'50'+
'100'+
'All'+
' records'
},
"sScrollY": "460px",
"bFilter": false,
} );
} );







<%
For i = 0 to Ubound(hdVals)
if i = 0 then
response.Write "" & hdVals(i) & "" & vbnewline
elseif i = 1 then
response.Write "" & hdVals(i) & "" & vbnewline
else
dstrVals(i-2,0) = hdVals(i)
response.Write "" & hdVals(i) & "" & vbnewline
end if
Next
%>



<%
EO = "odd"
For i = 1 to Ubound(tmpRows)-1
if EO = "odd" then
response.Write "" & vbnewline
else
response.Write "" & vbnewline
end if
tmpRowVals1 = split(tmpRows(i),"=")
tmpRowVals = split(tmpRowVals1(1),":")
For j = 0 to Ubound(tmpRowVals)
if j = 0 then
response.Write "" & tmpRowVals(j) & "" & vbnewline
elseif j = 1 then
if trim(tmpRowVals(j)) = "" then
response.Write " " & vbnewline
else
response.Write "" & tmpRowVals(j) & "" & vbnewline
end if
else
Call addToDistChart(j-2,tmpRowVals(j))
gTime = hdVals(j)
response.Write getCellColorWithClick(curlv(tmpRowVals(j)),tmpRowVals(0),gSec,gChar,gTime)
end if
Next
response.Write "" & vbnewline
if EO = "odd" then
EO = "even"
else
EO = "odd"
end if
Next
%>


[/code]

Sample image of what I have so far:

http://tinypic.com/r/9hhppy/7

Replies

  • marioangulomarioangulo Posts: 5Questions: 0Answers: 0
    edited July 2011
    I also noticed if I do the following

    [code]
    $(document).ready(function() {
    $('#myTable').dataTable( {

    "bJQueryUI": true,
    "oLanguage": {
    "sLengthMenu": 'Display '+
    '10'+
    '50'+
    '100'+
    'All'+
    ' records'
    },
    "sScrollY": "460px",
    "bFilter": false,
    "aoColumns": [
    null,
    { "sType": 'numeric' },
    null,
    null,
    null,
    null,
    null,
    null,
    null,
    null
    ]
    } );
    } );
    [
    [/code]

    It sorts the second row instead of the column which is really weird.
  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    If I'm reading hte code correctly - it looks like you have HTML in with the numbers - is that correct? Or is it just simple text like "99.00" in the TD? If you have HTML then you'll want the numbers with HTML plug-in: http://datatables.net/plug-ins/sorting#numbers_html - instructions for how it can be used are at the top of the page).

    Allan
  • marioangulomarioangulo Posts: 5Questions: 0Answers: 0
    Oh wow it worked I didn't catch that thanks Allan I love your product.
This discussion has been closed.