Trouble using custom filtering

Trouble using custom filtering

organicspiderorganicspider Posts: 12Questions: 0Answers: 0
edited April 2011 in General
I have added jQuery DatePicker into my page and using the example have tried to extend the filtering to use the date. This is what I have added so far[code]$.fn.dataTableExt.afnFiltering.push (
function( oSettings, aData, iDataIndex ) {
var sDate = document.getElementById('datepicker').value;
var sCallDate = aData[0].substr(0,10);

if ( sDate == "" )
{
return true;
}
else if ( sDate == sCallDate )
{
return true;
}
return false;
});

$('#datepicker').change ( function () { oTable.fnDraw(); } );
setInterval(function() { oTable.fnDraw(); }, 30000);
$(function() {
$( "#datepicker" ).datepicker({
showButtonPanel: true,
changeMonth: true,
changeYear: true
});
$('#datepicker').datepicker('option','dateFormat','yy-mm-dd');
});[/code]I have added alerts within the .push function and the dates are being picked up correctly. Any ideas ?
This discussion has been closed.