Fixed (Initial) Sorting

Fixed (Initial) Sorting

sacko87sacko87 Posts: 1Questions: 0Answers: 0
edited March 2011 in General
Hi All,

I am trying to generate a table where the first column has all of the column headers, essentially a horizontal table.

I have the output sorted out, the only issue I am having is keeping the ordering of the rows. I have created a custom sort type to simply return 0 and assigned it to a class name (like so):

[code]
jQuery.fn.dataTableExt.oSort['initial-order-asc'] = function(a,b) {
return 0;
};

jQuery.fn.dataTableExt.oSort['initial-order-desc'] = function(a,b) {
return 0;
};

"aoColumnDefs" : [
{ "sType" : "initial-order", "aTargets" : [ "dataTables_initialOrder" ] }
]
[/code]

I went by the assumption that returning 0 will leave it be.

I have made it a fixed column:

[code]
"aaSortingFixed" : [[ 0, 'asc' ]]
[/code]

Also adding the class to the element.

To begin with, it works fine. Sorting on the first column doesn't change the order of the "headers". The issue arises when sorting by other columns, it seems to ignore the fact that it is supposed to be fixed and messes up the first column.

Any help is greatly appreciated



Thanks

sacko
This discussion has been closed.