Problem with a custom edit button after using the create button

Problem with a custom edit button after using the create button

airmasterairmaster Posts: 72Questions: 15Answers: 2

I have a problem with the following code. If I click on "New" first, then abort that, then I use "Edit" on a row, the bottom button says "Create", not "Cancel" and "Save" like I would see if I reloaded the page, and just used "Edit" first.

Note that I am using a custom edit button for other reasons.

live.datatables.net/wopulepa/2/edit

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 15,118Questions: 1Answers: 2,583

    I think you need to do something like this example here - i.e. create the form buttons when you define the table buttons.

    Colin

  • airmasterairmaster Posts: 72Questions: 15Answers: 2

    Thanks for the reply. It didn't make much of a difference. Now there are no buttons on the edit form, unless I try the create first. I tried a couple of variations, but no difference.

    live.datatables.net/baposada/1/edit

  • allanallan Posts: 61,446Questions: 1Answers: 10,055 Site admin
    Answer ✓

    Hi,

    The reason this isn't working is that formButtons is something that is understood by the edit button. You aren't using the formButtons parameter anywhere in your custom button, so there is no update to the button that was previously configured.

    The way to do it is to pass the buttons you want to configure into the edit call: http://live.datatables.net/ravunoqi/1/edit .

    Allan

  • airmasterairmaster Posts: 72Questions: 15Answers: 2

    Thank you! I didn't seem to find such an example, but you can't show everything.

This discussion has been closed.