Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Here's a clean utility function you can use to accomplish this</p> <pre><code>function animatron (target, prop, duration, to, from, easing) { // return if no target or prop if (target == null || prop == null) { return; } // defaults if (duration == null) { duration = 250; } if (to == null) { to = 0; } if (from == null) { from = target.getHeight(); } if (easing == null) { easing = 'ease-out'; } // to property var t = {}; t[prop] = to; // from property var f = {}; f[prop] = from; // Animation Options var opts = { duration: duration, easing: easing, element: target.element, from: f, preserveEndState: true, to: t }; // Animation Object var anime = new Ext.fx.Animation(opts); // On animationend Event anime.on('animationend', function (animation, element, isInterrupted) { // Hide the target if the to is 0 if (to == 0 &amp;&amp; (prop == 'height' || prop == 'width')) { if (!isInterrupted) { target.hide(); } } // Update property if width or height if (prop == 'height') { target.setHeight(to); } if (prop == 'width') { target.setWidth(to); } // Dispatch 'animated' event to target target.fireEvent('animated', animation, element, to, from, isInterrupted); }); // Show the target if it's hidden and to isn't 0 if (target.getHidden() == true &amp;&amp; to != 0) { target.show(); } // Run the animation Ext.Animator.run(anime); } </code></pre> <p>You can listen for the 'animated' event on the target element</p> <pre><code>animatron(dataview, 'height', 500, 0); dataview.addListener('animated', function (animation, element, to, from, isInterrupted) { console.log('animation ended'); console.log('interrupted: '+ isInterrupted); }); </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload