datatable is not showing up. while debugging in firefox code inspector datatable code is shown in grey color.
Javascript code of datatable
$("#kt_datatable_noc").append('<table class="table table-striped table-bordered dt-responsive nowrap" style="width:100%" id="kt_datatable_noc1"> <thead><tr id="addDTRowHeading"><th>Portfolio Name</th><th>Expiry date</th><th>Expiry days</th></tr></thead></table>');
var dt_table = $("#kt_datatable_noc1").DataTable({
responsive: true,
searchDelay: 500,
processing: true,
serverSide: true,
ajax: {
url: "getNocExpiryDashboardList",
cache: false,
data: function (d) {
d.datat = sendingData();
},
},
lengthMenu: [10, 25],
iDisplayLength: 10,
// "paging": false,
ordering: false,
searching: false,
// "dom": '<"top"i>rt<"bottom"flp><"clear">',
columns: [
{ data: "portfolioName", width: "33%", className: "word-break" },
{ data: "toDate" , width: "33%"},
{ data: "datediff" , width: "33%"},
],
});
}
html code of datatable div
<div class="kt-datatable display" id="#kt_datatable_noc"></div>
data returned by json object by request
{
"aaData": [
{
"toDate": "2021-09-16",
"portfolioName": "abc",
"datediff": "-133",
},
{
"toDate": "2021-09-16",
"portfolioName": "asb",
"datediff": "-133",
}
],
"sEcho": 0,
"iTotalRecords": 2,
"iTotalDisplayRecords": 2
}
datatable is not showing up. firefox code inspector datatable code is shown in grey color.