Jump to content

Recommended Posts

Posted
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;
 
 

 

Posted

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);
}

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...