Problem with column level filtering
Problem with column level filtering
alekhine54
Posts: 2Questions: 0Answers: 0
I'm using jquery.dataTables.js V 1.9.3.
I'm using it in asp.net in this way:
//create table with string builder...
[code]
builder.Append("");
.....
builder.Append(" ");
builder.Append("");
builder.Append("");
builder.Append("");
builder.Append("");
[/code]
\\In script
[code]
$(document).ready(function () {
var oTable = $(".mws-datatable").dataTable({
oLanguage: {
"sSearch": "Search all columns:"
}
});
$(".mws-datatable-fn").dataTable({ sPaginationType: "full_numbers" });
$("tfoot input").keyup(function () {
/* Filter on the column (the index) of this element */
oTable.fnFilter(this.value, $("tfoot input").index(this));
});
/*
* Support functions to provide a little bit of 'user friendlyness' to the textboxes in
* the footer
*/
$("tfoot input").each(function (i) {
asInitVals[i] = this.value;
});
$("tfoot input").focus(function () {
if (this.className == "search_init") {
this.className = "";
this.value = "";
}
});
$("tfoot input").blur(function (i) {
if (this.value == "") {
this.className = "search_init";
this.value = asInitVals[$("tfoot input").index(this)];
}
});
});
[/code]
I'm not able to search column wise (separate search for each column). Any suggestions? Thanks.
I'm using it in asp.net in this way:
//create table with string builder...
[code]
builder.Append("");
.....
builder.Append(" ");
builder.Append("");
builder.Append("");
builder.Append("");
builder.Append("");
[/code]
\\In script
[code]
$(document).ready(function () {
var oTable = $(".mws-datatable").dataTable({
oLanguage: {
"sSearch": "Search all columns:"
}
});
$(".mws-datatable-fn").dataTable({ sPaginationType: "full_numbers" });
$("tfoot input").keyup(function () {
/* Filter on the column (the index) of this element */
oTable.fnFilter(this.value, $("tfoot input").index(this));
});
/*
* Support functions to provide a little bit of 'user friendlyness' to the textboxes in
* the footer
*/
$("tfoot input").each(function (i) {
asInitVals[i] = this.value;
});
$("tfoot input").focus(function () {
if (this.className == "search_init") {
this.className = "";
this.value = "";
}
});
$("tfoot input").blur(function (i) {
if (this.value == "") {
this.className = "search_init";
this.value = asInitVals[$("tfoot input").index(this)];
}
});
});
[/code]
I'm not able to search column wise (separate search for each column). Any suggestions? Thanks.
This discussion has been closed.