Change editor option "table" before open editor modal
Change editor option "table" before open editor modal

Hello everyone, can I dynamically change the name of the editor's table option, for example "#example" to "#example" + index after click editor button, before opening the modal?
var editor;
$(document).ready(function() {
editor = new $.fn.dataTable.Editor( {
ajax: "......",
table: "#example",
fields: [ {
label: "First name:",
name: "first_name"
......
]
} );
$('#example').DataTable( {
dom: "Bfrtip",
ajax: "../php/staff.php",
columns: [
........
],
select: true,
buttons: [
** { extend: "edit", editor: editor }**
]
} );
} );
Edited by Colin - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.
This discussion has been closed.
Answers
You can't change it, but you can create another Editor instance using the new name.
Colin