Datatable responsive not working after ajax call
Datatable responsive not working after ajax call
Hi, i have a datatable but when load data with ajax the responsive doesn´t work.
Here is my code:
HTML:
Codigo | Nombre | Simbolo | OperadoAMonedaNacional | CodigoBancoCentral |
---|
Javascript:
$.ajax({
type: "POST",
dataType: "json",
url: "Monedas.asmx/GetMonedasListado",
success: function (data) {
var datatableVariable = $('#dataTables-monedas').DataTable({
responsive: true,
bPaginate: true,
bFilter: true,
bInfo: true,
data: data,
columns: [
{ 'data': 'Codigo' },
{ 'data': 'Nombre' },
{ 'data': 'Simbolo' },
{ 'data': 'OperadoAMonedaNacional' },
{ 'data': 'CodigoBancoCentral' }
],
});
}
});
Thanks a lot!
Gonzalo
Answers
Have you downloaded the responsive extension? https://datatables.net/download/index
Hi Tester2017!
Yes, i download it.
The issue hapen only when i load data with ajax. I don´t know why...if i put the data in the html table works correctly.
Happy to take a look at a test page showing the issue so we can help to debug it.
Allan
Has there been any movement on this? I think I am suffering with the same thing
A pure HTML table on my page is working perfectly with responsive but a table populated by an AJAX call is not
Can you give me a link to a test case showing the issue please?
Allan
Responsiveness not working with dtOptions Ajax call. Following is my some part of code:
this.dtOptions = {
pagingType: 'simple_numbers',
pageLength: 10,
serverSide: true,
processing:false,
searching: false,
responsive: true,
autoWidth:false,
retrieve: true,
destroy: true,
deferRender: true,
language: {
processing: '<i class="fa fa - spinner fa-spin fa-3x fa - fw"></i><span class="sr - only">Loading...</span>'
},
order: [[1, 'desc']],
ajax: (dataTablesParameters: any, callback) => { }
::
::
When I review the Angular 6 page in Mobile, datatable is not breaking properly. I am getting (+) icon to expan child rows but not working and columns are not breaking to fit the table into mobile view.
Any help on this issue?
Any updates on this?
This post is a year old with a request for a test case showing the issue. I would suggest creating a new thread with your specific information so we can help. And if you can provide a link to your page or a test case that would help even more.
https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case
Kevin
Here is an AJAX example that does work:
https://datatables.net/extensions/responsive/examples/initialisation/ajax.html
Kevin
When i was trying to combine the below example, it is not working.
https://datatables.net/blog/2017-03-31
https://datatables.net/extensions/responsive/examples/display-types/immediateShow.html
@chetannr : that sounds like a different issue to the OP. Can you create a new thread and provide a test case demonstrating the problem, please.