beforeDestroy

<< Click to Display Table of Contents >>

Navigation:  Events >

beforeDestroy

Previous pageReturn to chapter overviewNext page

 

Build on the example used in onDestroy

 

1. Select Button

 Expand the Events tab

 Select the Event - beforeDestroy ... box

 

2015-08-25_17-40-57

 

The following function and code are generated.

 

       _button_beforedestroy:function (profile){

           var ns = this, uictrl = profile.boxing();

       },

 

Add in a Confirm Alert so we can see a response on the screen before the destroy. It will all happen to quickly otherwise

 

       _button_beforedestroy:function (profile){

           var ns = this, uictrl = profile.boxing();

          xui.confirm("title","caption",function(){ xui.alert('yes');ns.button.destroy(); },function(){ xui.alert('no'); },"Oh Yeah","Nope",50,50);

       },

 

(Search the API for the full details of xui.confirm)

 

Save the changes & refresh the browser.