Introduction
JSForms' main goal is to help developers create rich and interactive web pages. It allows developers to focus on the web page design instead of messing around with complicated scripts and ensures web page works correctly in all browsers. The library provides facilities to create custom controls and comes with the most widely used controls out of the box.
Currently the library is in the early stages of development, but it already has a menu control (including context menu) and tree control. Some of the API might change as I continue to work on optimizing the code to make sure every useful feature is present. In the future new controls will be added to the library.
All JSForm controls share the same base class. This ensures certain common functionality and some of the features are present in every control. In addition all controls are separated into several parts (logical structure, behavior and style) that can be customized and maintained separately from each other.
Features
Most notable common features:
- Customizability - As mentioned previously controls consist of three parts. Each part is customizable. Most of the customization will probably be applied to the control style. Sometimes control behavior. Control structure (where and which HTML elements are used and how they relate to each other) should not have to be modified often, if ever.
- Common API - Since controls share common parent class, most basic API will be shared between them automatically.
- Different ways to initialize - Controls (for now) support two different ways of being created. First is to write appropriate HTML (in the form control would expect to see it) on the page and attach a new control to it. Second is to allow new control generate all HTML on its own and customize it by calling different methods. You can mix and match them (attach control to pre-generated HTML and customize it using JavaScript).
- Automatic disposal - Every control automatically frees allocated memory when the page is unloaded. This ensures the browser doesn't leak any resources. The process is very fast and fully automated.
- Automatic reuse - Controls (by default) add a reference to themselves to the DOM object they are attached to. When another attempt is made to create a new control for the same HTML element, previously created control is returned. This behavior can be disabled.
Limitations
Controls also have several limitations. They include missing or not fully implemented features. In time I will attempt to complete or address all of them. For more details consult JSForms Control documentation.