Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
893 มุมมอง

Hello,

does someone have an example for me how i can call a JS Function from a Button in the Header of a Form?

The Button is added to an existing Form.


I tried a lot but nothing works. So i hope for your help.


Thanks in advance

André

อวตาร
ละทิ้ง

Header means near create button

ผู้เขียน คำตอบที่ดีที่สุด

Hey Jenish, 

first thanks for your answer.

I dont have a Problem to add the Button to the Header. My Problem is more the Javascript Part.

With the Click on the Button i want to call a Javascript Function.

So i added a js-file to static/src/js with the following content:

Then i try to add it as action on the Button but it doenst work.

Does anyone have a running example?

Thanks

อวตาร
ละทิ้ง

in the button try t-on-click=" " instead of action

คำตอบที่ดีที่สุด

Check this cybrosys blog

https://www.cybrosys.com/blog/how-to-add-a-create-button-near-tree-kanban-view-in-odoo-15

อวตาร
ละทิ้ง