Duplicate Action resulting in simple edit instead of create
Duplicate Action resulting in simple edit instead of create
gordonc200
Posts: 39Questions: 7Answers: 0
in Editor
Using the code here
https://editor.datatables.net/examples/api/duplicateButton
Specifically
{
extend: "selected",
text: 'Duplicate',
action: function ( e, dt, node, config ) {
// Start in edit mode, and then change to create
editor
.edit( table.rows( {selected: true} ).indexes(), {
title: 'Duplicate record',
buttons: 'Create from existing'
} )
.mode( 'create' );
}
my local setup simply edits the row when I try to duplicate a record. The action is an edit and not a create.
I thought it might be because I was using an out of date library but have changed to 1.8 and the same thing happens.
Any ideas?
This question has accepted answers - jump to:
This discussion has been closed.
Answers
I hadn't updated the CDN but I'm struggling
Much of this is out of date but simply updating the whole link to the latest doesn't work either. Is there an easy way of updating the above that will work?
First thing to do is check that the
action
parameter being sent to the server iscreate
. Is it? You can check in the Network panel of your browser's inspector.The Editor plug-ins aren't available on the CDN any more I'm afraid.
Allan
HI Allan
The action parameter is edit which is the problem.
I'll target my own server instead of the CDN. Hopefully that will sort it.
Worth updating your Editor instance as well if you haven't updated recently.
mode()
as a setter was 1.7+.Allan
Yup. Basically my whole library was out of date. All updated now and works.
Many thanks.