Detail deleting

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

Detail deleting

Post by montserat03 »

Dear experts,

I just have a simple question..

If I want an event happens when user click delete button on the master detail form.. ( WHEN USER DELETING A DETAIL DATA )
let say I want to show message ( this record deleted..? ) yes or no..
where should I put my code..?

the row deleting or row deleted of detail table.?
or in the startup script of the master table.?

thank u so much


Webmaster
User
Posts: 9427

Post by Webmaster »

Just enable "Inline delete (Modal dialog)" and "Cascase Delete", read Table Setup and its "Master/Detail" section in the help file.


montserat03
User
Posts: 32

Post by montserat03 »

i need to call my function when user click the DELETE DETAIL BUTTON... let say function Recalculate ....

Where should I place the coding to call this recalculate function? thank u


arbei
User
Posts: 9352

Post by arbei »

You can subscribe the "click" event of the button by the id or class of the button.

You can right click on the button and choose "Inspect" to check the id or class of the button.


mobhar
User
Posts: 11702

Post by mobhar »

montserat03 wrote:
Where should I place the coding to call this recalculate function?

Try to put it under "Client Scripts" -> "Table-Specific" -> "List Page" -> "Startup Script".


montserat03
User
Posts: 32

Post by montserat03 »

If I want to add my code or call my function when user click the DELETE BUTTON on the detail where should I call my function

For the add button I know that I can use = $(".ewAddBlankRow").click(function(){

but for the delete.. I don't know what class or method I should use.... Please help..

thank u so much


kirondedshem
User
Posts: 642

Post by kirondedshem »

For the add button I know that I can use = $(".ewAddBlankRow").click(function(){
but for the delete.. I don't know what class or method I should use.... Please help.

$(".ewAddBlankRow") uses jquery to locate elements with class = "ewAddBlankRow". Similary there are various ways to locate elements using jquery. You can find an element using more than one class, you can find an element using the attributes etc etc.
So find one of the delete buttons and inspect it, for example when I inspect the delete button it looks like below.

<a class="btn btn-default ewGridLink ewGridDelete btn-sm" title="" data-caption="Delete" onclick="return ew_DeleteGridRow(this, 1);" data-original-title="Delete"><span data-phrase="DeleteLink" class="glyphicon glyphicon-trash ewIcon" data-caption="Delete"></span></a>

So I can choose to find all these buttons using the attribute class="btn btn-default ewGridLink ewGridDelete btn-sm" like this.
$('[class="btn btn-default ewGridLink ewGridDelete btn-sm"]')

I can also choose to locate the same buttons using the attribute data-original-title="Delete" like this.
$('[data-original-title="Delete"]')

You can console log any of the above selectors to see that they work before applying them
eg console.log($('[class="btn btn-default ewGridLink ewGridDelete btn-sm"]'))

There are alot of ways to go about this just ensure to choose a unique query value for your selectors depending on how the element looks after inspection.


Post Reply