Problem with a custom edit button after using the create button

Problem with a custom edit button after using the create button

airmasterairmaster Posts: 71Questions: 15Answers: 1

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: 8,013Questions: 0Answers: 1,348

    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: 71Questions: 15Answers: 1

    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: 51,411Questions: 1Answers: 7,752 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: 71Questions: 15Answers: 1

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

Sign In or Register to comment.