DataTables warning: table id=datatable-buttons - Requested unknown parameter '0' for row 1, column 0
DataTables warning: table id=datatable-buttons - Requested unknown parameter '0' for row 1, column 0
buenz
Posts: 5Questions: 1Answers: 0
I got this error when using this code. There is a null data that was inserted in the first row before my retrieved data
function retrieve_user(){
$.ajax({
url:'../conn/callFunc.php',
method:'POST',
data:{
_trans:'retrieve_user'
},
success:function(msg){
var table = $('#datatable-buttons').DataTable();
table.rows.add( $(msg) ).draw();
}
})
}
This discussion has been closed.
Answers
Assuming that
msg
has the correct data structure you will probably want to change the above line to:Kevin
When i change the code. It still produce an error and it populates 1.6k+ of data to the table.
I believe that error provides a link to help you troubleshoot:
https://datatables.net/manual/tech-notes/4
What are your findings from following the steps provided?
Without knowing your table structure and the structure of the data being returned its hard to help. Maybe you can provide a ink to your page with the issue.
Kevin
https://ibb.co/h7uqf6 - with ($(msg))
https://ibb.co/b40ADR - with (msg)
($(msg))
Ok, you are returning HTML then?
Can you post your HTML table structure?
Can you post the returned HTML?
Kevin
I created an example:
http://live.datatables.net/wawitutu/1/edit
Adding HTML formatted table data works in the example using the code you have provided.
There must be something in the HTML data being returned from your ajax call. Can you post the returned HTML? If not can you post a link to your page for troubleshooting?
Kevin
It looks like you are returning 3 rows. You are providing only a portion of the returned data using screenshots which is not providing enough info to help. Can you post the actual text of the full returned HTML?
Or put your returned data into the test case I provided? You will need to remove one column.
Kevin