detailed information in data table dont work when refreshing using ajax.
detailed information in data table dont work when refreshing using ajax.
sexyGirl
Posts: 4Questions: 1Answers: 0
I have implemented a Child rows (show extra / detailed information) data table plugin and works good; nevertheless, I update the table using Ajax, at first the table didn't charge but I read that adding the sentence 'destroy : true', the problem would be solved and it was true, but now when the table charges for the first time I can open and close details but if I refresh the table using ajax the table charges good but the details quit working.
What should I do?
Thank you :*
This discussion has been closed.
Answers
When you recreate the table you probably need to reapply the event hook you are using.
I have this code, the problem is that the second time the table charges the instruction "var row = table.row(tr);" and gives back an ´undefined´.
function refrescaTabla() {
var opt = $("#cmbAreasNegocio").val();
$.get("areasNegocios/" + opt + "/puestos", function(datos) {
}
function format ( d ) {
//
d
is the original data object for the rowvar desc='
';
return desc;
}
Try moving the on click code (line 17 ...) into the InitComplete option of your datatables declaration.
thank you I'll try
I found the problem!
a can't believe that the jquery's method "on" was the trouble
$('#tblDocumentos').on('click','tbody td.details-control', function(
finally i change my code for the version below and I add the instruction
delete row.