disable master-detail copy

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
digitalphotoworld
User
Posts: 416
Location: Nürnberg/Germany

disable master-detail copy

Post by digitalphotoworld »

Hello,
I want disable master-detail-copy - but not the normal copy of a record. If I disable copy in table setup, both options are disabled.
Can I solve this problem via page_render event or anything else?


mobhar
User
Posts: 11767

Post by mobhar »

Simply put the following code in "Startup Script" under "Client Scripts" -> "Table-Specific" -> "List Page" and also under "Client Scripts" -> "Table-Specific" -> "View Page":

$(document).ready(function() {
$('.ewDetailCopy').hide();
});


digitalphotoworld
User
Posts: 416
Location: Nürnberg/Germany

Post by digitalphotoworld »

Thanks, mobhar, but code is working only in footer.php. This is not a problem, because I want to disable it on all pages.

Isn't there another solution to disable the button, because I didn't like to use jQuery for everything. jQuery is a great tool for Ajax, toggle Elements etc., but I dislike to use it for redesign of the whole page.


mobhar
User
Posts: 11767

Post by mobhar »

To disable in all pages, then simply move the code to "Startup Script" under "Client Scripts" -> "Global" -> "Pages with header/footer".


digitalphotoworld
User
Posts: 416
Location: Nürnberg/Germany

Post by digitalphotoworld »

Yes I did that.

But I still looking for a solution without jQuery, any ideas?


mobhar
User
Posts: 11767

Post by mobhar »

If you want to do that from Server Events, then simply put the following code in "Page_Load" of the List page:

// assume your detail table is "orderdetails"
$GLOBALS["orderdetails_grid"]->DetailAdd = FALSE;


Post Reply