Create button
Create button
Hi Allan,
I am following the tutorial here
https://editor.datatables.net/reference/button/create
as I want to add a 2nd button on the Create modal window. My first button does the normal Create....
for my 2nd button I have the following code
formButtons: [
{
label: 'Create/Approve',
fn: function () { this.submit(); }
},
What I want to do, is to make sure I have some way of differentiating between these two submissions so I know one is Create and the other is Create/Approve on the backend. Is there a way? Seems like "action" is "create" for both and there's no other parameter to distinguish the buttons.
This question has an accepted answers - jump to answer
Answers
Would setting a variable be acceptable - I think that's the only way that you would be able to tell the server which has been clicked. You could have an extra field in the form which is hidden from the end user (
hidden
) and then callfield().val()
to set the value in your custom button, letting the server know that that button was clicked.Allan
Thank you, yes that will work