datatable resposive not working if 2-3 colums we use
datatable resposive not working if 2-3 colums we use
i am using data table responsive modal popup display columns details but its not working properly if we use 1-2 columns here i attach two different link one is working one is not working
working link : http://test.mithilphotos.com/Admin/CompanyInformationList.aspx
not working link : http://test.mithilphotos.com/Admin/ActivityList.aspx
below code i use :
<script type="text/javascript" lang="javascript">
$(document).ready(function () {
var table
table = $('#example').removeAttr('width').DataTable({
"filter": true,
"autoWidth": true,
"scrollCollapse": false,
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "ActivityList.aspx/GetTableData",
"fnServerData": function (sSource, aoData, fnCallback) {
$.ajax({
"dataType": 'json',
"contentType": "application/json; charset=utf-8",
"type": "GET",
"url": sSource,
"data": aoData,
"success": function (msg) {
var json = jQuery.parseJSON(msg.d);
fnCallback(json);
$("#example").show();
},
error: function (xhr, textStatus, error) {
if (typeof console == "object") {
console.log(xhr.status + "," + xhr.responseText + "," + textStatus + "," + error);
}
}
});
},
responsive: {
details: {
type: 'control',
target: '.glyphicon-info-sign',
display: $.fn.dataTable.Responsive.display.modal({
header: function (row) {
var data = row.data();
return 'Details for ' + data[1];
}
}),
renderer: $.fn.dataTable.Responsive.renderer.tableAll({
tableClass: 'table'
})
}
},
columnDefs: [{
className: 'control',
orderable: false,
targets: 0
}],
order: [1, 'asc']
});
});