Hello,
I would like to have the possibility to insert several entries with similar content one after the other.
For this I wanted to replace the "Create" button with two buttons: "Create" and "Create and close".
The "Create" button should create an entry but leave the form open so that I can adjust the contents of the form to create another entry.
However, with my current code there is still the problem that the form is reset after creating. Is there a way that this does not happen?
new $.fn.dataTable.Buttons(table, [
{
extend: 'create',
editor: editor,
formButtons: [
{
text: 'Create and close',
className: 'btn-primary',
action: function () {
this.submit();
},
},
{
text: 'Create',
className: 'btn-secondary',
action: function () {
const that = this;
this.submit(function () {
that.create();
}, null, null, false);
},
},
],
},
{ extend: 'edit', editor: editor },
{ extend: 'remove', editor: editor },
]);