Page 1 of 1

Detail deleting

Posted: Sun Nov 05, 2017 8:41 am
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


Re: Detail deleting

Posted: Sun Nov 05, 2017 9:38 am
by Webmaster

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


Re: Detail deleting

Posted: Sun Nov 05, 2017 11:18 am
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


Re: Detail deleting

Posted: Mon Nov 06, 2017 11:42 am
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.


Re: Detail deleting

Posted: Mon Nov 06, 2017 11:48 am
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".


Re: Detail deleting

Posted: Thu Nov 16, 2017 8:07 am
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


Re: Detail deleting

Posted: Thu Nov 16, 2017 1:07 pm
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.