Sencha触摸动画的后处理程序没有功能

时间:2013-02-09 08:07:22

标签: extjs sencha-touch sencha-touch-2

我正在使用Sencha touch 2.0.1.1。 在视图中我在容器的dragend函数中做一些动画,在这个动画结束时我想要执行更多的东西,但是after处理程序没有将函数作为处理程序。这是代码

                Ext.Animator.run({
                    element: dataview.element,
                    duration: 500,
                    autoClear : true,
                    easing: 'ease-in',
                    preserveEndState: true,
                    to: {
                        height: to_h
                    },
                    from: {
                        height: dataview.element.getHeight()
                    },
                    after: function() {
                        console.log ("After run");
                    }     
                });

这是我得到的错误:

Uncaught Error: [ERROR][Ext.fx.animation.Abstract#applyAfter] Invalid config, must be a valid config object Console.js:17

但如果我这样做,这会有所作为:

                Ext.Animator.run({
                    element: dataview.element,
                    duration: 500,
                    autoClear : true,
                    easing: 'ease-in',
                    preserveEndState: true,
                    to: {
                        height: to_h
                    },
                    from: {
                        height: dataview.element.getHeight()
                    },
                    after: {
                        fn : console.log (this)
                    }
                });

因为除了console.log之外我还想做一些事情,所以有人可以建议我使用这个处理程序来执行一个就地编写或在视图中编写的函数吗?

1 个答案:

答案 0 :(得分:0)

尝试'onEnd:'而不是'after:'