Horizontal scrolling plus individual column filtering problem
Horizontal scrolling plus individual column filtering problem
I have used horizontal scrolling plus individual column filtering (mix text box and select box).
Page format looks nice initially, but when I do sorting or filtering, my filter boxes or I can say footer whole row gets disappear.
Somebody please help me. Below is my code.
[code]
In javascript-
(function($) {
$.fn.dataTableExt.oApi.fnGetColumnData = function ( oSettings, iColumn, bUnique, bFiltered, bIgnoreEmpty ) {
// check that we have a column id
if ( typeof iColumn == "undefined" ) return new Array();
// by default we only wany unique data
if ( typeof bUnique == "undefined" ) bUnique = true;
// by default we do want to only look at filtered data
if ( typeof bFiltered == "undefined" ) bFiltered = true;
// by default we do not wany to include empty values
if ( typeof bIgnoreEmpty == "undefined" ) bIgnoreEmpty = true;
// list of rows which we're going to loop through
var aiRows;
// use only filtered rows
if (bFiltered == true) aiRows = oSettings.aiDisplay;
// use all rows
else aiRows = oSettings.aiDisplayMaster; // all row numbers
// set up data array
var asResultData = new Array();
for (var i=0,c=aiRows.length; i -1) continue;
// else push the value onto the result data array
else asResultData.push(sValue);
}
return asResultData;
}}(jQuery));
/* range filter { */
function createRange(iCol){
var maxid = 'col' + iCol + 'max';
var minid = 'col' + iCol + 'min';
$.fn.dataTableExt.afnFiltering.push(
function ( oSettings, aData, iDataIndex ) {
var iMin = document.getElementById(minid).value * 1;
var iMax = document.getElementById(maxid).value * 1;
var iColumn = aData[iCol] == "-" ? 0 : aData[iCol]*1;
if ( iMin == "" && iMax == "")
return true;
else if ( iMin == "" && iColumn <= iMax)
return true;
else if ( iMin <= iColumn && iMax == "")
return true;
else if ( iMin <= iColumn && iColumn <= iMax)
return true;
return false;
}
);
return '
';
} /* range filter } */
function fnCreateSelect( aData )
{
var r='', i, iLen=aData.length;
for ( i=0 ; i
Page format looks nice initially, but when I do sorting or filtering, my filter boxes or I can say footer whole row gets disappear.
Somebody please help me. Below is my code.
[code]
In javascript-
(function($) {
$.fn.dataTableExt.oApi.fnGetColumnData = function ( oSettings, iColumn, bUnique, bFiltered, bIgnoreEmpty ) {
// check that we have a column id
if ( typeof iColumn == "undefined" ) return new Array();
// by default we only wany unique data
if ( typeof bUnique == "undefined" ) bUnique = true;
// by default we do want to only look at filtered data
if ( typeof bFiltered == "undefined" ) bFiltered = true;
// by default we do not wany to include empty values
if ( typeof bIgnoreEmpty == "undefined" ) bIgnoreEmpty = true;
// list of rows which we're going to loop through
var aiRows;
// use only filtered rows
if (bFiltered == true) aiRows = oSettings.aiDisplay;
// use all rows
else aiRows = oSettings.aiDisplayMaster; // all row numbers
// set up data array
var asResultData = new Array();
for (var i=0,c=aiRows.length; i -1) continue;
// else push the value onto the result data array
else asResultData.push(sValue);
}
return asResultData;
}}(jQuery));
/* range filter { */
function createRange(iCol){
var maxid = 'col' + iCol + 'max';
var minid = 'col' + iCol + 'min';
$.fn.dataTableExt.afnFiltering.push(
function ( oSettings, aData, iDataIndex ) {
var iMin = document.getElementById(minid).value * 1;
var iMax = document.getElementById(maxid).value * 1;
var iColumn = aData[iCol] == "-" ? 0 : aData[iCol]*1;
if ( iMin == "" && iMax == "")
return true;
else if ( iMin == "" && iColumn <= iMax)
return true;
else if ( iMin <= iColumn && iMax == "")
return true;
else if ( iMin <= iColumn && iColumn <= iMax)
return true;
return false;
}
);
return '
';
} /* range filter } */
function fnCreateSelect( aData )
{
var r='', i, iLen=aData.length;
for ( i=0 ; i
This discussion has been closed.
Replies
Thanks,
Allan
I am having this issue as well and do duplicate it just add the basic table structure and then add the reference to datatables and columnFilter and then on the datatable def add either of the sScroll's and when you type in the filter text box it will filter and then the input box disappears