How to add an Edit Button

Dear all,

can you give me an example to add an Edit button for a item in the display form?

Many thanks

Tom

Dear @TWendt,
What do you mean? Edit button for the current item should be available by default, on top of the form:
image

Or do you mean something else?

I mean not the default button. I hide the default buttons. I need a button to edit the item

Best wishes
Tom

Dear @TWendt,
If the buttons are hidden, but not removed, the following code should work - it will click the Edit button:

fd.toolbar.buttons[0].click();

Thanks for your answer, but I need a third Edit button to open the item. Is it possible to use the Click property?

Best wishes
Tom

Dear @TWendt,
Try it! What do you mean the third? Are there two already? The code above simply clicks the default Edit button, which can be hidden, but still clicked with code.

Hello Nikita,

sorry for the late answer. Your solution does not work. I added in CSS

.fd-toolbar-primary-commands {
visibility: hidden;
}

I need a third button on the lower right side.

Dear @TWendt,
What exactly is not working? The buttons on the lower right side are custom added, you can add a third button with the code I've provided above. The CSS is to hide the toolbar on top of the form, not to hide the custom buttons.

Ist okay now. Sorry. I expressed myself incorrectly. I need a button that opens the item in the edit mode.

Best wishes
Tom

Dear @TWendt,
You can add a button from the controls:

Set the Click to this code:

fd.toolbar.buttons[0].click();
1 Like