I am using In table form controls:
https://editor.datatables.net/examples/simple/inTableControls.html
Using this with multiple tables on the same page (tables are hidden by default, and shown through a drop-down list), the class of the form control is not sufficient to identify the correct table. E.g.:
$('#learning_event_table').on('click', 'a.editor_edit', function (e) {
e.preventDefault();
editor.edit( $(this).closest('tr'), {
title: 'Edit record',
buttons: 'Update'
} );
} );
$('#amc_graduate_outcome_table').on('click', 'a.editor_edit', function (e) {
e.preventDefault();
editor.edit( $(this).closest('tr'), {
title: 'Edit record',
buttons: 'Update'
} );
} );
Editing a record in#amc_graduate_outcome_table
, then attempting to edit a record in #learning_event_table
, results in a record in #amc_graduate_outcome_table
being available for edit.
A workaround may be to substitute the class a.editor_edit
for an ID but I haven't tested this yet. Alternatively, find the closest table then row, which perhaps requires an update to the editor code??