Product Update: Ext JS 8.0 is Coming Soon! Learn More

New! Try dark mode

Top Support Tips

March 30, 2015 1999 Views

Get a summary of this article:

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

Recommended Articles

Why JavaScript UI Components Matter More in Complex Frontend Architecture

What This Article Covers Why UI components matter – In complex frontend architecture, reusable JavaScript UI components help manage scale, improve performance, and ensure consistency…

Custom vs Prebuilt JavaScript UI Components – Which Is Better for Enterprise

What This Article Covers Build vs. Buy decision – Whether to build custom JavaScript UI components, use open-source libraries, adopt commercial solutions, or follow a…

How a JavaScript UI Framework Reduces Frontend Complexity

Frontend development has become dramatically more sophisticated over the last decade. What once involved a few scripts and styled pages has evolved into the engineering…

10 Common UI Pain Points in Large-Scale JavaScript Applications

At a small scale, many frontend decisions appear harmless. A team may: create a custom component quickly skip accessibility for one release add a one-off…

Common Responsive Design Challenges in Enterprise Web Applications

Modern businesses run on software that must work everywhere – on a desktop monitor in a corporate office, on a tablet carried across a warehouse…

Why Enterprise UI Development Gets Complicated Faster Than Teams Expect

Enterprise UI development refers to designing and building user interfaces for business-critical software used by organizations, departments, regulated industries, and large operational teams. These applications…

View More