w2base - base class, implements event handling, can be exteded
w2field - field class, can be extended
w2form - form class, can be extended
w2grid - grid class, can be extended
w2layout - layout class, can be extended
w2sidebar - sidebar class, can be extended
w2tabs - tabs class, can be extended
w2toolbar - toolbar class, can be extended
However, starting with version 2.0, you can load libaray as ES6 module and these variables will not be registered globally
by default. If you link w2ui as type "module"
All objects you create - layouts, grids, toolbars, sidebars, tabs, forms - will be attached to global w2ui object.
Initially it is an empty object, but as soon as you start creating widgets, 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:
xxxxxxxxxx
1
w2ui['myGrid'].get(3); // returns record with id=3
2
// or
3
w2ui.myGrid.get(3);
4
w2locale
This object holds all variables for localization purposes, such as date and tiem format, currency format, number format,
days of weeks, months names, and translation phrases.
To load different locale use w2utils.locale
w2utils
This global object has useful functions for data validation, data sanitation, data formatting, encoding, etc.
For example, you can check if a string is in email format by:
xxxxxxxxxx
1
w2utils.isEmail('som@email.com'); // returns true if the string is a valid email
All w2ui classes can be extended and in such way a new and/or custom functionality can be added to grid, toolbar,
sidebar, tabs, etc. For example, to extend a grid, do the following: