Unable to get multi column filter text box displayed.

Unable to get multi column filter text box displayed.

Mr_AndersonMr_Anderson Posts: 3Questions: 0Answers: 0
edited November 2011 in General
I am trying to do a multi column filter as shown in this page (http://www.datatables.net/examples/api/multi_filter.html) using a array that contain all the data (called 'my_array_data') but I could not get those filter text box displayed.

Below is the code:

[code]



var asInitVals = new Array();

$(document).ready(function() {


$('#dynamic').html( '' );
var oTable = $('#example').dataTable( {
"aaData": my_array_data,
"bProcessing": true,
"bAutoWidth": false,
"fnInitComplete": function() {
var oSettings = this.fnSettings();
for ( var i=0 ; i0){
$("tfoot input")[i].value = oSettings.aoPreSearchCols[i].sSearch;
$("tfoot input")[i].className = "";
}
}
},
"aoColumns": [
{
"sTitle": "From",
"sClass": "center",
"sWidth": "10%"
},
{
"sTitle": "To",
"sClass": "center",
"sWidth": "10%"
},
{
"sTitle": "Note",
"sClass": "center",
"sWidth": "5%"
}
]
} );


$("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]

For your info: I do not have a [code] ... [/code] as mention before that I store my data in the array called ''my_array_data' and therefore do not have [code][/code].

Any Insight in working with my array "my_array_data"?

("my_array_data" contain three column - basically named as - "From", "To", and "Note")

Thanks.

Replies

This discussion has been closed.