In w2ui library there are several global variables.
w2ui
This global variable that holds all created w2ui objects such as layouts, grids, toolbars, sidebars, tabs, and forms.
Initially this variable is an empty object, but as soon as you start creating controls, they will become part of
this object. This object serves two important purposes:
It provides a common and uniform way for accessing created objects
It makes sure that you will not overwrite already created object (object name must be unique)
For example, if you created a grid with name myGrid then it can be accessed in the following manner:
w2obj
This global variable gives you access to widget prototypes, so that you can attach a method to prototype and it will be instantly
available in all objects of that type. For example:
w2utils
This global variable has useful generic functions for data validation, data sanitation, data formatting, encoding, etc.
For example, you can check if a string is in email format by:
See w2utils.methods for more information.