"sType": "numeric" --- not working
"sType": "numeric" --- not working
Hi All,
I have been working with dataTables for a week now. It seems like a good tool. I am having an issue with the stype sorting not working.
When I add "sType": "numeric" in the aoColumns def it stops sorting. Without the "sType": "numeric" it sorts the rows but not correctly for numeric.
Let me know if I am doing anything wrong.
Thanks
Phil
$(document).ready(function() {
var oTable = $("#projects_table").dataTable({
"oLanguage": {
"sSearch": "Search all columns:"
},
"sPaginationType": "full_numbers",
"bJQueryUI" : true,
"aaSorting": [[ 3, "desc" ]],
"aoColumns" : [
{"bSortable": true, "bSearchable": true, "bVisible": false, "sType": "numeric" },
{"bSortable": true, "bSearchable": true, "bVisible": false },
{"bSortable": true, "bSearchable": true, "bVisible": false },
{"bSortable": true, "bSearchable": true, "bVisible": false },
{"bSortable": true, "bSearchable": true, "bVisible": false },
{"bSortable": true, "bSearchable": true, "bVisible": false },
{"bSortable": true, "bSearchable": true, "bVisible": true }]
});
/* Activity */
oTable.fnSortListener( document.getElementById('sorter0'), 0 );
/* Date */
oTable.fnSortListener( document.getElementById('sorter1'), 1 );
/* Downloads */
oTable.fnSortListener( document.getElementById('sorter2'), 2 );
/* Followers */
oTable.fnSortListener( document.getElementById('sorter3'), 3 );
/* Owner Name */
oTable.fnSortListener( document.getElementById('sorter4'), 4 );
/* Project Name */
oTable.fnSortListener( document.getElementById('sorter5'), 5 );
/* Views */
oTable.fnSortListener( document.getElementById('sorter6'), 6 );
});
<%@include file="header.jsp"%>
Activity
Creation Date
Downloads
Followers
Owner Name
Project Name
Views
I have been working with dataTables for a week now. It seems like a good tool. I am having an issue with the stype sorting not working.
When I add "sType": "numeric" in the aoColumns def it stops sorting. Without the "sType": "numeric" it sorts the rows but not correctly for numeric.
Let me know if I am doing anything wrong.
Thanks
Phil
$(document).ready(function() {
var oTable = $("#projects_table").dataTable({
"oLanguage": {
"sSearch": "Search all columns:"
},
"sPaginationType": "full_numbers",
"bJQueryUI" : true,
"aaSorting": [[ 3, "desc" ]],
"aoColumns" : [
{"bSortable": true, "bSearchable": true, "bVisible": false, "sType": "numeric" },
{"bSortable": true, "bSearchable": true, "bVisible": false },
{"bSortable": true, "bSearchable": true, "bVisible": false },
{"bSortable": true, "bSearchable": true, "bVisible": false },
{"bSortable": true, "bSearchable": true, "bVisible": false },
{"bSortable": true, "bSearchable": true, "bVisible": false },
{"bSortable": true, "bSearchable": true, "bVisible": true }]
});
/* Activity */
oTable.fnSortListener( document.getElementById('sorter0'), 0 );
/* Date */
oTable.fnSortListener( document.getElementById('sorter1'), 1 );
/* Downloads */
oTable.fnSortListener( document.getElementById('sorter2'), 2 );
/* Followers */
oTable.fnSortListener( document.getElementById('sorter3'), 3 );
/* Owner Name */
oTable.fnSortListener( document.getElementById('sorter4'), 4 );
/* Project Name */
oTable.fnSortListener( document.getElementById('sorter5'), 5 );
/* Views */
oTable.fnSortListener( document.getElementById('sorter6'), 6 );
});
<%@include file="header.jsp"%>
Activity
Creation Date
Downloads
Followers
Owner Name
Project Name
Views
This discussion has been closed.
Replies
Thanks
Phil
Allan
Thanks,
Allan