how to create a new button (print) inside the view, edit, copy button to print the detail record. thanks
Create new button inside view edit botton
-
- User
- Posts: 121
i want to create PRINT botton in spesific table (list page). ListOptions_Load only view, edit, copy and delete. I want to create a print button to print the detail record for example print detail record 1. I'm still confused how to use it. Sorry new be. thanks
-
- User
- Posts: 11703
mobhar wrote:
Please read "Server Events and Client Scripts" topic from PHPMaker Help menu for
more information and example.
As mentioned, then please see "Example 1" from that Help topic above. You should be able to follow it. Always try it by yourself first. Post your code for more discussion.
-
- User
- Posts: 121
ListOptions_Load syntax is $this->ListOptions->Item["name"].
the detail table names are :
•checkbox
•view
•copy
•delete
•edit
•detail_<DetailTable> - Detail table column
•details - the Multiple Master/Detail column
•preview - column for preview row of the Detail Preview extension (for registered users) only
•sequence - column for sequence number
•button - column for button group or button dropdown
but i want to create PRINT button
-
- User
- Posts: 980
Here are what you need to do:
ListOptions_Load()
- Add the item into the list. // ->Add["yourItem"]
- If needed arrange the item among the items. // ->MoveTo()
Once you have the item, you need to render it:
ListOptions_Rendered()
- $body = '<your html code for button link/print>';
- Put the $body as your item. // ->Items["yourItem"]->Body = $body
Place the url of "whatever table you need to print" inside $body html code. Refer to generated button element (browser press F12) for the code, adjust the target url. The url should contain ...export=print....
For direct printing you can add onclick="window.print()" in the code.
Hope it clear.