4
votes

Here is My sourcecode:

Ext.create('Ext.window.Window', {
    id:'edit_segtype_win',
    title:'msg',
    layout: 'fit',
    html:data,
    modal:true,
    resizable:false,
    constrain:true
}).show(undefined,bind_ajax_success);

When i call show(...),the window will show without any animation. I want to add some animation,such as fadein/fadeout/slidein/slideout. Can somebody help me? Thank you!

1

1 Answers

4
votes

You can use Anim object http://docs.sencha.com/extjs/4.2.0/#!/api/Ext.fx.Anim to use in your Window Component like this:

var myWindow = Ext.create('Ext.window.Window', {
    html:"hello world",
});

Ext.create('Ext.fx.Anim', {
    target: myWindow,
    duration: 1000,
    from: {
        width: 400, //starting width 400
        opacity: 0,       // Transparent
        color: '#ffffff', // White
        left: 0
    },
    to: {
        width: 300, //end width 300
        height: 300 // end height 300
    }
});

And then, that animation is added when your call to

window.show();