Register datepicker with the datatables ajax call

Register datepicker with the datatables ajax call

drakula1234drakula1234 Posts: 58Questions: 1Answers: 0
edited May 2012 in General
I am wondering how to make my datepicker make an ajax request to the server. I have created a feature plugin to include the datepicker in the sDom and my code doesn't seem to be registered with the datatables.

[code]
var DatePicker = function(oDTSettings) {
oDTSettings.aoDrawCallback.push({
"fn" : function() {
var label = $("").attr('for', "from").text('Date:');
var input = $('').attr({id: 'from', name: 'from'});

input.appendTo(label);
$("#datepicker").append(label);
input.datepicker({onSelect: function(fromDate, inst){
$.ajax({"type": "POST",
"url": ".......?fromDate=" +fromDate
});
}});

},
"sName" : "DatePickerControl"
});
};

$.fn.dataTableExt.aoFeatures.push( {
"fnInit": function(oDTSettings) {
return new DatePicker(oDTSettings);
},
"cFeature": "D",
"sFeature": "DatePickerControl"
});
[/code]

Replies

  • drakula1234drakula1234 Posts: 58Questions: 1Answers: 0
    edited May 2012
    Can someone help me with this please.. and I haven't quite figured it out...
This discussion has been closed.