How to add button in Standalone collection editor?
How to add button in Standalone collection editor?
Link to test case: https://editor.datatables.net/examples/standalone/collection.html
Description of problem: I need to add 2 buttons in this place
https://www.dropbox.com/scl/fi/izic4yzvjw2hiu17iop5z/Zrzut-ekranu-2023-12-09-03.46.53.jpg?rlkey=oyfm7yuf5vfzfqlf0ri15eqry&dl=0
One for reseting data in the form (erase all) and second for ajax query that will send an email (so i have to post form_id).
I have no idea how to do it in the table from the linked test case.
I was thinking to add template: '#customForm'
but dont know where
Any ideas?
Answers
See if this thread and this example help add buttons to the Editor form.
Kevin
Thanks for fast answer Unfortunately, I tested the example you linked earlier and it does not work in this case (Standalone collection editor).
My code is:
Still i have only Save button and i cant add another. CustomForm dont want to work too.
PS. The code has minimal changes compared to the example, but they are not significant (I have 20 such tables on one page - as a calendar)
Hi,
It looks like you are passing the
buttons
object to the$.ajax
configuration object. That is going to be ignored there since jQuery doesn't do anything with abuttons
property. Moreover, the code there is for a DataTables Buttons collection - not the buttons found in the Editor form.is what defines the button in your editing view. Currently just a button that says "Save" (default action is to submit).
You need to define your custom button in there:
Allan