Sencha Ext JS 7.7 is Here – Discover What’s New and Exciting – LEARN MORE

Top Support Tips

March 30, 2015 180 Views
Show

Top Support Tips

Everlasting Scrollbars

by Kevin Cassidy

Have you ever wished you could always display your Touch container’s scrollbars instead of them automatically appearing and disappearing? Now you can. With this simple override, you can make use of Ext.scroll.View’s private indicatorsHidingDelay property. This override causes the container scroll bars to be visible whenever the indicatorsHidingDelay property is set to a negative value. If you want to return to the default behavior, you can call the setIndicatorsHidingDelay method with a positive value.

You can see the everlasting scrollbar in action here:
https://fiddle.sencha.com/#fiddle/fuo

Note: This is a great tip but be cautious about using private configurations, methods and events. They may change at any point and their use is not supported if other issues occur.


on Destroyable

by Seth Lemmons and Greg Barry

Developers can easily add event listeners to Components and Elements by utilizing Ext.mixin.Observable’s on() method (shortcut for addListener()). That said, you may need to remove those listeners while maintaining the Component or Element to which they were attached. You canuse un() (shortcut for removeListener()) by passing it the same config and scope used with on(). However, there is a shortcut offered by on() that may be better suited to your needs — destroyable: true.

By default, the destroyable option is false. When set to false, on() will return the Component or Element to which the handlers were attached (Ext JS 4.x returns undefined). However, with destroyable: true, an object is returned with a destroy() method. When called, it will destroy the previously set event handlers while preserving your Component or Element.

You can see the destroyable config in action here:
https://fiddle.sencha.com/#fiddle/f8i

coming soon

Something Awesome Is

COMING SOON!