Create new button inside view edit botton

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
cahsolonomer1
User
Posts: 121

Create new button inside view edit botton

Post by cahsolonomer1 »

how to create a new button (print) inside the view, edit, copy button to print the detail record. thanks


mobhar
User
Posts: 11703

Post by mobhar »

You may simply use "ListOptions_Load" and "ListOptions_Rendered" server events.

Please read "Server Events and Client Scripts" topic from PHPMaker Help menu for more information and example.


cahsolonomer1
User
Posts: 121

Post by cahsolonomer1 »

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


mobhar
User
Posts: 11703

Post by mobhar »

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.


cahsolonomer1
User
Posts: 121

Post by cahsolonomer1 »

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


arbei
User
Posts: 9359

Post by arbei »

Have you tried the example in help file topic: "Server Events and Client Scripts" -> "ListOptions_Load" and "ListOptions_Rendered"?

Also read the notes about the option "Use buttons as links" and "Use button dropdown for links".


sangnandar
User
Posts: 980

Post by sangnandar »

Here are what you need to do:

ListOptions_Load()

  1. Add the item into the list. // ->Add["yourItem"]
  2. If needed arrange the item among the items. // ->MoveTo()

Once you have the item, you need to render it:

ListOptions_Rendered()

  1. $body = '<your html code for button link/print>';
  2. 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.


cahsolonomer1
User
Posts: 121

Post by cahsolonomer1 »

Ok thanks for all..
problem solved.....


apis
User
Posts: 124

Post by apis »

cahsolonomer1 wrote:
Ok thanks for all..
problem solved.....

Can u please share the code for printing.
Thanks


Post Reply