Can Someone Please check this?
Can Someone Please check this?
Hi , I am quite new to datatables. It has been a great tool. I am incorporating into a new project of mine. I am trying to use select drop down filters to filter the table on a column.The code looks like below.. which I have written after going through the forums.
[code]
$(document).ready(function() {
var oTable=$('#example').dataTable({
"bSort": true,
"bAutoWidth": false,
"bProcessing": true,
"sPaginationType": "full_numbers",
"sDom": 'TC<"clear">lfrtip',
"oTableTools": {
"sSwfPath":"media/swf/copy_cvs_xls_pdf.swf","aButtons": [ "copy", "csv","xls"]
}});
function thegreatfilter(id,oTable,$column){
if (id=="0"){
oTable.fnFilter("",$column,false);
} else {oTable.fnFilter("^"+id+"$",$column,true);}
};
$('#theuprouteno').change(function(){
var id=$(this).val();
var $column=4;
thegreatfilter(id,oTable,$column);
}
);
})
[/code]
While the code works fine ,there are a few things , when the value of the select is anything apart from 0, the filter happens very fast.However when it is 0, on chrome there is no difference in speed, firefox the lag is quite visible , and IE is very slow.
The table is made in the DOM by a php loop.
Can someone please help me with this... What am I doing wrong here?
Thanks!
[code]
$(document).ready(function() {
var oTable=$('#example').dataTable({
"bSort": true,
"bAutoWidth": false,
"bProcessing": true,
"sPaginationType": "full_numbers",
"sDom": 'TC<"clear">lfrtip',
"oTableTools": {
"sSwfPath":"media/swf/copy_cvs_xls_pdf.swf","aButtons": [ "copy", "csv","xls"]
}});
function thegreatfilter(id,oTable,$column){
if (id=="0"){
oTable.fnFilter("",$column,false);
} else {oTable.fnFilter("^"+id+"$",$column,true);}
};
$('#theuprouteno').change(function(){
var id=$(this).val();
var $column=4;
thegreatfilter(id,oTable,$column);
}
);
})
[/code]
While the code works fine ,there are a few things , when the value of the select is anything apart from 0, the filter happens very fast.However when it is 0, on chrome there is no difference in speed, firefox the lag is quite visible , and IE is very slow.
The table is made in the DOM by a php loop.
Can someone please help me with this... What am I doing wrong here?
Thanks!
This discussion has been closed.