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
});
Asht TPosted Jul 27, 2022, 6:01 AM
@Satya Karki
I try this solution , this is work but my datatable is dynamically bind using database that time datetime picker not work
Satya KarkiPosted Jul 22, 2022, 6:48 AM
Vishal YelvePosted Jul 19, 2022, 12:10 PM
Asht TPosted Jul 19, 2022, 9:56 AM
@Sachin Singh
Thank u.....I try in this way but this solution not work please check attached file
Sachin SinghPosted Jul 19, 2022, 6:37 AM