I have a jquery datatable with a column of text input filed. What I want is to integrate a datepicker for this input.
But my datepicker is not working for this input as usual. So I tried it with the createdRow callback in datatables, something like below:
var col = [
{data:"first_name","width":"100px"},
{data:"last_name"},
{data:"start_date",
render: function (data){
return "<input type='text' class='datepicker' value='" + data + "'/>"
}}
];
var thistable = $('#example1').DataTable( {
data:dataSet,
select:{style:'single'},
columns:col,
createdRow:function(row){
var TinyDatePicker = DateRangePicker.TinyDatePicker;
TinyDatePicker($(".datepicker", row), {
//mode: 'dp-below',
format(date) {
return date.toLocaleDateString("fr-CA");
},
})
},
dom: 'frtip'
});
Can somebody help me to right direction?