Bob Schneider
asked on
NOT having JQuery DataTable Columns Sort
I would like three columns (6, 7, and 8...the three time columns)
on this page to NOT have the sort capabilities...since they don't sort anyway. :) How can I do that please?
Thanks!
on this page to NOT have the sort capabilities...since they don't sort anyway. :) How can I do that please?
Thanks!
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
In a perfect world I would like the to sort and worked on Scott's suggestion, also previously suggested. Couldn't get it to work...almost certainly user error...
Tried this from zephyr_hex but got an error:
This generates no error but also allows those columns to be sortable...incorrectly, of course.
Tried this from zephyr_hex but got an error:
<script>
$(document).ready(function() {
$('#results').DataTable( {
"lengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]],
"order": [[ 0, 'asc' ]],
"columnDefs": [
{
"targets": [6,7,8],
"orderable": false
],
"ajax": {"url":"data_source_example.asp?race_id=<%=lRaceID%>"}
} );
} );
</script>
This generates no error but also allows those columns to be sortable...incorrectly, of course.
<script>
$(document).ready(function() {
$('#results').DataTable( {
"lengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]],
"order": [[ 0, 'asc' ]],
"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 didn't see your output, but for time, it is suggested to use moment.js to normalize the time output.
ASKER
Thanks Scott. I will try that again at some point because I do want it to sort on the time columns but, for now (with some bigger races coming this weekend) I will leave it as is. I am learning a lot through this process thanks to those of you who are contributing to these posts. AT some point I will need to go to aspJSON as you and Big Monty have suggested.
ASKER