Bob Schneider
asked on
JQuery & Classic ASP
The journey continues...
1) So I am using JQuery DataTable with no server side processing and all is doing fine except that finish times are sorted as text. I hate to go to server side processing to solve that but maybe I have to? I don't want the time 1:02:03.45 to show up before 30:45.67 in the results.
2) Can I have a cheat sheet on installing/using aspJSON? I thought I had to join GitHub but apparently not. Would using this utility solve my sorting problem?
3) I am also going to need to start passing variables (like RaceID). Does that require server side processing and/or aspJSON.
1) So I am using JQuery DataTable with no server side processing and all is doing fine except that finish times are sorted as text. I hate to go to server side processing to solve that but maybe I have to? I don't want the time 1:02:03.45 to show up before 30:45.67 in the results.
2) Can I have a cheat sheet on installing/using aspJSON? I thought I had to join GitHub but apparently not. Would using this utility solve my sorting problem?
3) I am also going to need to start passing variables (like RaceID). Does that require server side processing and/or aspJSON.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
BTW, the main cause of the excessive load time of the orignal page is collecting the data that you see when you click on someone's name.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you. I am having a hard time with the render. If I want to order columns 6, 7, 8 by hh:mm:ss (when clicked on) what would that look like in reference to the script below?
"render": function ( data, type, row ) {
return data +' ('+ row[3]+')';
},
"targets": 0
},
{ "visible": false, "targets": [ 3 ] }
I believe you can simply render something like
"render": function (data, type, row) {
return data.getHours() + ":" + data.getMinutes() + ":" + data.getSeconds();
}
ASKER
Ok I tried that and I get "loading message". Still trying to figure out how to identify and manage errors. Does this look problematic syntactically?
<script>
$(document).ready(function() {
$('#results').DataTable( {
"lengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]],
"order": [[ 0, 'asc' ]],
"columnDefs": [
{
"type": "date",
"targets": [6,7,8] ,
"render": function (data, type, row) {
return data.getHours() + ":" + data.getMinutes() + ":" + data.getSeconds();
}
}
],
"ajax": {"url":"data_source_example.asp?race_id=<%=lRaceID%>"}
} );
} );
</script>
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I suspect that perhaps the format you are providing your dates in are not parseable by javascripts Date.parse() function which is what DataTables uses behind the scenes to work with / sort by datetime. Does this work without the render function, by simply applying 'date' to your column type?
ASKER
You could be right but it is pretty standard for the display of running race times. Regarding just the "date", nope. I am going to abandon the sort by time question. Thanks for all your help.
ASKER
Here is a sample of my current results page
Here is where I am at on the rebuild...miles to go before I sleep...or run...