herculanojs Posted September 5, 2017 Posted September 5, 2017 I am having trouble closing forms that have extevents for example in beforeclose, and when closing the form by exemple using a button and in your click simply run close. The extevents events do not run. exemple: 1) extevents function window.beforeclose(panel, eOpts) { panel.animate({ duration: 300, to: { x:-1000, opacity: 0} }); } 2) form procedure TUniForm1.btnFecharClick(Sender: TObject); begin close; end; Quote
Sherzod Posted September 5, 2017 Posted September 5, 2017 Hi, It can be done by using "after", "callback" methods of the animate object, I guess Quote
Sherzod Posted September 5, 2017 Posted September 5, 2017 For example like this: 1. function window.beforeInit(sender, config) { sender.animationEnded=false; } 2. function window.beforeclose(panel, eOpts) { me = panel; if (!me.animationEnded) { me.animate({ duration: 1000, to: { x: -1000, opacity: 0 }//, //callback: function(evt, obj) { // me.animationEnded=true; // me.close(); //} }); Ext.defer(function(){ me.animationEnded=true; me.close(); }, 100); } return (me.animationEnded); } Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.