This following trick will show you the powerful of PHPMaker 10 that allows you to insert a new link near by the Export Options. We will use Page_Render server event for this purpose. Just for your information, Page_Render existed since version 10. This trick is very useful if you want to insert your custom link near by the Export Options without having to customize the template or to customize the generated code.
Let's say, in the List page, you want to insert a new link right after the Send to Email link option. When the link is clicked, then it will call the certain Javascript function.
Of course, from the example of code below, you have to create your own YourJavaScriptFunction() so that when that custom link is clicked, then it will run that Javascript function. You can actually remove the onclick part and assign the href part to call/run the certain file.
[hidepost]
Simply put the following code into Page_Render server event under Server Events -> Table-Specific -> List Page.
$options = &$this->ExportOptions; $item = &$options->Add("MyNewExportLink"); $item->Body = "<a class=\"ewAction\" href=\"\" onclick=\"YourJavaScritpFunction();return false;\">My New Link</a>";
[/hidepost]
Jian Yi Yang says
good, sometimes I need to implment “data import function” it suitly put it together with “export” function