Tables collapse when remove row using editor
Tables collapse when remove row using editor
Hi team,
I have 7 DataTables and Editors respectively for Mon to Sun.
I uses them to add, edit and remove staff's timesheets.
Everything else is working perfectly.
But when I remove a row (especially when I quickly remove multiple rows), the 7 tables sometimes collapse, and data outside the table bound with ajax does not change.
Even if I click submit button(bound with ajax) to show the tables again, it does not work. So I have to refresh the page.
Could you please help have a look on my code? And I also suspect should I use 7 tables and editors~ but could not figure out a better solution yet. Thank you very much!
Here is the code that bound with event. I also have tried add a "remove" event and etc, but still does not work.
editorMon
// .on('edit', function (e, type) {}
//.on('remove', function (e, type) {}
.on('submitSuccess', function (e, type) {
$.ajax({
async: false,
url: "inc/backend/data_retrieval/getTimesheetSummaryHours.php",
method: "POST",
data: {
selectedUser: selectedUser,
weekStartDay: weekStartDay,
weekEndDay: weekEndDay
},
success: function (data) {
RenderAjax(data);
}
});
})
This question has an accepted answers - jump to answer
Answers
Collapsing the table is not something Datatables will do. You must have another function or event handler that is called that collapses the tables. We will need to see the problem to help debug. Please provide a link to your page or a test case replicating the issue.
https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case
Kevin