Hi I am getting response like {"empList1":[],"empList2":[]}
and I want to render those on jsp where I have created table and in .js file I'm rendering like -
[I am getting isSummaryDataTableExists , detailDataTableReportName also]
$('#'+detailDataTableReportName).DataTable({
"bServerSide": false,
"aoColumns":[I'm getting columns name list here],
"bProcessing": false,
"data": [I'm getting response here],
"bJQueryUI": false,
"bFilter": false,
"bSort":false,
"dom": 'rt<"bottom"flp> ',
"fnInitComplete" : function(oSettings, json) {
if ($("#"+detailDataTableReportName).dataTable().fnSettings().aoData.length == 0) {
}else{
}
}
});
if(isSummaryDataTableExists) {
$('#'+detailDataTableReportName+'Summary').DataTable({
"bServerSide": false,
"bProcessing": false,
"data": [I'm getting columns name list here],
"aoColumns":[I'm getting response here],
"bJQueryUI": false,
"bFilter": false,
"dom": 'rt<"bottom"flp> ',
"bSort":false,
"paging": false,
"lengthChange": false,
"fnRowCallback": function( nRow, aData ) {
if(!isSummaryDataTableHeaderExists) {
$("#"+detailDataTableReportName+"Summary thead").remove();
}
var $nRow = $(nRow); // cache the row wrapped up in jQuery
$nRow.css({"background-color":"#f5f5f5","font-weight": "bold"});
return nRow;
},
"fnInitComplete": function (oSettings, json) {
if ($("#"+detailDataTableReportName+"Summary").dataTable().fnSettings().aoData.length == 0) {
$('#'+detailDataTableReportName+'Summary').parents('div.dataTables_wrapper').first().hide();
}
}
});
}
Please help I'm not able to find where I'm doing mistake.