About "Allow Add"

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

About "Allow Add"

Post by skymark »

I have a master/detail adding page. For the detail table "item", I checked "Allow Add" for one field. The "Add item" link doesn't appear on the detail rows. Is there a way to make it appear there?


mobhar
User
Posts: 11905

Post by mobhar »

I don't think so, since the detail section is displayed in "Table" (tabular) style, and not in the "Form" style.

You can only display such "Add item" link when the Add page is being displayed individually (not in a Master/Detail style).


Webmaster
User
Posts: 9438

Post by Webmaster »

Copy the link from the Add/Edit page and insert into the List page at where you want. You can use Startup Script (see Server Events and Client Scripts in the help file) and use jQuery, e.g. (v10)

$("<a ...>Add xxx</a>").insertBefore("Your selector"); // or use insertAfter()

Also read: http://api.jquery.com/category/manipula ... n-outside/


skymark
User
Posts: 183

Post by skymark »

Thank you all.

I need to have a link exactly the same as the one on the individual add/edit pages, i.e. when users click on "Add item", it will pop up a page to allow users to add an item, and after adding, the combo box next to the link should make the newly added item to be selected automatically. Other combo boxes on the detail rows should have the newly added item on their lists. When users hit "add blank row", the new detail row should show the "Add item" link after the combo box of "Item". Is there a way to do it?


danielc
User
Posts: 1599

Post by danielc »

The adoption link is triggered by on click event to start js function, ew_AddOptDialogShow. You need to use jQuery to add the link to the appropriate position like Wedmaster say. You can reference to demo project cars table trademark field in edit/add page to see what need to put into the link and what parameter to put into ew_AddOptDialogShow function.


Post Reply