dataTable showing more than one global search textbox
dataTable showing more than one global search textbox
All was well but lately my datatable is showing more than one global search filter. My per column search filters still work fine and this multiple search textbox thing only happens sometimes. Here's my code:
[code]
$.fn.dataTableExt.sErrMode = 'throw';
var oTable = null;
// try/catch will prevent exceptions from stopping script continuation
try {
oTable = $('#SymbolsGrid').dataTable({
"oLanguage": {
"sSearch": "Search all columns:"
},
"bPaginate": false,
"bInfo": false
});
$("thead input").keyup(function () {
/* Filter on the column (the index) of this element */
oTable.fnFilter(this.value, $("thead input").index(this));
});
/*
* Support functions to provide a little bit of 'user friendlyness' to the textboxes in
* the footer
*/
$("thead input").each(function (i) {
asInitVals[i] = this.value;
});
$("thead input").focus(function () {
if (this.className == "inputBox") {
this.className = "";
this.value = "";
}
});
$("thead input").blur(function (i) {
if (this.value == "") {
this.className = "inputBox";
this.value = asInitVals[$("thead input").index(this)];
}
});
}
catch (e) {
}[/code]
[code]
$.fn.dataTableExt.sErrMode = 'throw';
var oTable = null;
// try/catch will prevent exceptions from stopping script continuation
try {
oTable = $('#SymbolsGrid').dataTable({
"oLanguage": {
"sSearch": "Search all columns:"
},
"bPaginate": false,
"bInfo": false
});
$("thead input").keyup(function () {
/* Filter on the column (the index) of this element */
oTable.fnFilter(this.value, $("thead input").index(this));
});
/*
* Support functions to provide a little bit of 'user friendlyness' to the textboxes in
* the footer
*/
$("thead input").each(function (i) {
asInitVals[i] = this.value;
});
$("thead input").focus(function () {
if (this.className == "inputBox") {
this.className = "";
this.value = "";
}
});
$("thead input").blur(function (i) {
if (this.value == "") {
this.className = "inputBox";
this.value = asInitVals[$("thead input").index(this)];
}
});
}
catch (e) {
}[/code]
This discussion has been closed.