Single Click performs two operation when used DataTable.ColumnFilter

Single Click performs two operation when used DataTable.ColumnFilter

gangofmumbaigangofmumbai Posts: 2Questions: 0Answers: 0
edited December 2013 in General
Hi,
I am using ColumnFilter for filtering the content of table based on Drop down. Through when i click on drop down menu for corresponding Column it get sorted automatically.

Is there any way i can stop the auto sorting when clicked on column header for which Filtering is applied?

Below is sample of my code
[code]
$(document).ready(function(){
var oTable = $('#example').dataTable({
bJQueryUI: true,
//"sPaginationType": "full_numbers",
"iDisplayLength" : -1
});
var items = [];
// getting all the elements from second column
$('#example>tbody>tr>td:nth-child(2)').each( function(){
//add item to array
items.push( $(this).text() );
});
//console.log("items:" + items);
// Finding a unique elements from Second Column
var uniqueSubSystems = $.grep($.unique(items),function(values){
return values != "";
});
//console.log("Unique Items" + uniqueSubSystems);
oTable.columnFilter({ sPlaceHolder: "head: before",
aoColumns: [ null,
{ type: "select", values: uniqueSubSystems },
{ type: "select", values: [ 'INFO', 'WARNING', 'ERROR', 'CRITICAL'] },
null
]

});
});
[/code]

Thanks in advance!!!

Replies

  • gangofmumbaigangofmumbai Posts: 2Questions: 0Answers: 0
    i found the answer thanks..!!!
    [code]
    var oTable = $('#example').dataTable({
    bJQueryUI: true,
    //"sPaginationType": "full_numbers",
    "iDisplayLength" : -1,
    bSort: false
    });
    [/code]
This discussion has been closed.