Data Table Filtering
Data Table Filtering
praveen_j
Posts: 2Questions: 0Answers: 0
I have used datatable filtering based on option, One of the column having date but while filtering the date, it will not ordering properly, and i need to use calendar (while clicking button,displays current month calendar,pickup any one date) to filter that particular column.
This discussion has been closed.
Replies
For integrate a datepicker have a look here: http://datatables.net/forums/discussion/7634/about-the-search-input-in-datatable
Hope it gives you a start. I have not done the date filtering at the moment, but this task will be on my plate soon, too, I guess.
Regards
$(document).ready(function() {
/* Initialise the DataTable */
var oTable = $('#example').dataTable( {
"iDisplayLength": 5,
"aLengthMenu": [[5,10, 25, 50, -1], [5,10, 25, 50, "All"]],
"bJQueryUI": true,
"sPaginationType": "full_numbers",
"oLanguage": {
"sSearch": "Search all columns:"
}
} );
/* Add a select menu for each TH element in the table footer */
$("tfoot th").each( function ( i ) {
if( i!=0 && i!=1 && i!=5 && i!=11)
{
this.innerHTML = fnCreateSelect( oTable.fnGetColumnData(i) );
$('select', this).change( function () {
oTable.fnFilter( $(this).val(), i );
} );
} else if(i==0)
{
this.innerHTML = '';
$('select', this).change( function () {
oTable.fnFilter( $(this).val(), i );
} );
}
} );
}
Actually i need one column filter (i=0) as date picker and remains using tag, i worked with above code, i don't know exactly where i did mistake.