Add to order "Button" in every record

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

Add to order "Button" in every record

Post by apis »

Hi all,
I would like to set Add to order "Button" in every record when multi column is enabled.
and when the user click on that button it goes to order table.
if its possible pls. drop a help.
Thank you


arbei
User
Posts: 9406

Post by arbei »

You may see the topic Server Events and Client Scripts > "ListOptions_Rendering" and "ListOptions_Rendered" server events.


apis
User
Posts: 124

Post by apis »

Thanx,

This is my " ListOptions Load event"

function ListOptions_Load() {
$this->ListOptions->Add("lunch_x");
$this->ListOptions->Items["lunch_x"]->Header = "<b>Add To Order</b>";
}

This is my "ListOptions Rendered event"
function ListOptions_Rendered() {
$this->ListOptions->Items["lunch_x"]->Body = "<a href='./lunchlist.php?Code=".CurrentTable()->Code->CurrentValue."'>Add to Cart</a>";
}
this gives me the button as want to, but now what i want to do is when the user clicks on that button, copy that clicked record to another table.
please give me so suggestions.
Thank you


mobhar
User
Posts: 11745

Post by mobhar »

You may simply use "Row_CustomAction" and "Page_Load" server events that belong to the List Page, in order to do some custom actions such as insert to another table based on each row.

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


apis
User
Posts: 124

Post by apis »

Thank.
Got it done


Post Reply