How to add datetimepicker inside datatable......
My code is like following but this is not working
var RegObj = {
ENNo: $('#txtENNo').val()
}
var RegObj = {
ENNo: $('#txtENNo').val(),
ApprovalID: ApprovalID
}
// $("#LoadingImage").show();
$(function () {
$.ajax({
type: "POST",
url: '@Url.Action("SetInstDatatable", "SRegInstallment")',// "/RptStudOMSStudent/GetReportDetails",
// data: "{'AcadYear':'" + AcadYear + "','CourseID':'" + CourseID + "','BranchID':'" + BranchID + "','ClassID':'" + ClassID + "','DivisionID':'" + DivisionID + "','CType':'" + CType + "','CategoryID':'" + CategoryID + "'}",
data: JSON.stringify(RegObj),
contentType: "application/json; charset=utf-8",
dataType: "json",
success: OnSuccess,
failure: function (response) {
alert(response.d);
},
error: function (response) {
alert(response.d);
}
});
});
function OnSuccess(response) {
$("#tblInstallment").DataTable(
{
bRetrieve: true
})
$("#tblInstallment").DataTable(
{
destroy: true,
bLengthChange: false,
// lengthMenu: [[10, 50, -1], [10, 50, "All"]],
bFilter: false,
bSort: false,
bPaginate: false,
// dom: 'Bfrtip',
data: response,
columns: [
//{'data': 'InstallementAmount'},
{
"data": "InstallmentAmount", "name": "InstallmentAmount", "autoWidth": true,
"render": function (data) { return GetInstAmount(data) }
},
{
"data": "DueDate", "name": "DueDate", "autoWidth": true,
"render": function (data) { return GetDueDate(data) }
},
]
});
function GetDueDate(data) {
// return ""
return '';
}
function GetInstAmount(data) {
if (insttype == "Equal") {
return '';
}
else {
return '';
}
}
};
$(".datepicker").datepicker({
defaultDate: "dd-M-yy",
changeMonth: true,
changeYear: true,
width: 50,
dateFormat: "dd-M-yy",
inline: true
});

Sachin SinghRank #66 · 26.2K reputationPosted Jul 19, 2022, 2:37 AM EDT
Asht TRank #5,917 · 282 reputationPosted Jul 19, 2022, 5:56 AM EDT
@Sachin Singh
Thank u.....I try in this way but this solution not work please check attached file
Vishal YelveRank #178 · 13.6K reputationPosted Jul 19, 2022, 8:10 AM EDT
Satya KarkiRank #78 · 24.6K reputationPosted Jul 22, 2022, 2:48 AM EDT
Asht TRank #5,917 · 282 reputationPosted Jul 27, 2022, 2:01 AM EDT
@Satya Karki
I try this solution , this is work but my datatable is dynamically bind using database that time datetime picker not work