Duplicate Button Problam
Duplicate Button Problam

i create duplicate,edit and remove button like this:
{
data: null,
"orderable": false,
className: "center",
defaultContent: "<button class='btn btn-outline btn-success btn-sm editor_edit' style='border-radius: 40%;margin: auto;display: block'><i class='fas fa-pen' style='margin: 2px -2px 0px -1px;font-size:19px'></i></button>"
},
{
data: null,
className: "center",
"orderable": false,
defaultContent: "<button class='btn btn-outline btn-primary btn-primary btn-sm editor_duplicate' style='border-radius: 40%;margin: auto;display: block'><i class='fas fa-clone' style='margin: 2px -2px 0px -1px;font-size:19px'></i></button>"
},
{
data: null,
className: "center",
"orderable": false,
defaultContent: "<button class='btn btn-outline btn-primary btn-danger btn-sm editor_remove' style='border-radius: 40%;margin: auto;display: block'><i class='fas fa-trash-alt' style='margin: 2px -2px 0px -1px;font-size:19px'></i></button>"
}
now i want to disable field only on edit mode, its work fine in create and edit mode, but in duplicate this disable also the field, how i can make the only on edit mode i will disable field, and all other mode include duplicate not?
This discussion has been closed.
Answers
I'm struggling to understand this, sorry. Could you link to your page or create a test case, please, that would help picture this.
Colin
i just want to disable field in editor only in edit mode,
but instead its happens when i also click on duplicate button
The Duplicate, if based on this example, isan extension of Edit, so would trigger the same code. Probably the easiest thing to do is to set a flag/variable in the
action
function of that example, which you then check in yourinitEdit
. You would then clear the flag/variable in theclose
.Colin