Add dropdown, datepicker using sDom
Add dropdown, datepicker using sDom
drakula1234
Posts: 58Questions: 1Answers: 0
I am not sure if it is possible to add the dropdown and date picker beside the search filter using sDom or are there any other ideas to implement it. I am kind of confused how to implement it. Did anyone try to implement it.
This discussion has been closed.
Replies
Allan
I have tried something like this.. this doesn't create the label and textbox unless I create the div tag with the id "datepicker" in the jsp page. Can someone give me a solution for this to get added beside the search filter.
[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();
},
"sName" : "DatePickerControl"
});
};
$.fn.dataTableExt.aoFeatures.push( {
"fnInit": function(oDTSettings) {
return new DatePicker(oDTSettings);
},
"cFeature": "D",
"sFeature": "DatePickerControl"
});
[/code]
I have included the following code in the input.datepicker() function but I need this something more deeply integrated into the datatables.
[code]
onSelect: function(fromDate, inst){
$.ajax({"type": "POST",
"url": ".......?fromDate=" +fromDate
});
}
[/code]