aoColumns completly ignored

aoColumns completly ignored

ThalliusThallius Posts: 31Questions: 4Answers: 0
edited August 2013 in General
Hi,

my table ignores the aoColumns function completly. I have tried several sTypes and nothing changes. Finally I want to sort with enum-plugin, but the test alert in the plugin function is never called.

[code]
var toolTable = null;
$(document).ready(function()
{
/* create sort handler for modality column */
jQuery.extend( jQuery.fn.dataTableExt.oSort,
{
"enum-pre": function ( a )
{
alert("1");
return modalities[a].shortname;
},

"enum-asc": function ( a, b )
{
alert("2");
return ((a < b) ? -1 : ((a > b) ? 1 : 0));
},

"enum-desc": function ( a, b )
{
alert("3");
return ((a < b) ? 1 : ((a > b) ? -1 : 0));
}
});

$('#toolTable tbody').on( 'click', 'tr', function ()
{
var data = toolTable.fnGetData( this );
editTool(data);
});

toolTable=$('#toolTable').dataTable(
{
"sScrollY": $('#content').height()-74-26,
"sScrollX": $('#content').width(),
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "./datasource/ge_get_tool.php",
"bStateSave": true,
"aoColumns":
[
null,
{ "sType": "enum" },
null,
null,
null
],

"fnCreatedRow": function( nRow, aData, iDataIndex )
{
/* disabled for debugging sort
var id=modalitiesCross[aData[1]];
if(id!=undefined)
{
$('td:eq(1)', nRow).html( modalities[id].shortname );
}
*/
var description=aData[2].replace(/\n/g, '
');
if(description.length)
{
$('td:eq(2)', nRow).html( description );
}
}
});
});
[/code]

Regards

Claus

Replies

  • allanallan Posts: 63,510Questions: 1Answers: 10,471 Site admin
    > "bServerSide": true

    Sorting and filtering are being done at the server. Sorting and filtering plug-ins on the client-side will have absolutely no effect.

    Allan
This discussion has been closed.