O'Reilly logo

Ext JS Essentials by Stuart Ashworth, Andrew Duncan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Configuring classes

Ext JS offers us a useful way of creating configurable properties, which gives us an autogenerated process to get and set their values, and also to perform any updates required in other areas; for example, reflecting the updated value in the UI.

When a class is defined, any properties found in the config object become completely encapsulated from other class members and are given their own getter and setter methods.

For example, if we move our Config class' version property into a config object, as shown in the following code snippet, the class will be given two new methods named getVersion and setVersion. Notice that we must create a constructor function and call the initConfig method to have the class system initialize these ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required