Thursday, July 2, 2015

Benefits of ExtJS:



Why did you choose Ext JS?
Given the wide range of JavaScript libraries available it was important to choose the right one. We needed to choose a library that was consistent in the way that it presents information to the user, but also consistent in the way that you code using the library.

With all Ext components extending the ‘Observable’ class we had the ability to write consistent code in an event-driven manner, much like writing a desktop application, not easily achieved with other libraries. What’s more is that we knew it would work cross-browser, again something not easily achieved that saves countless hours on large projects.

Get to know Ext JS

Ext JS began as a project to extend the functionality that the YUI Library offered. A key aspect of the YUI Library is the cross-browser support, which you'll also find in Ext JS. This support allows you to build Web applications without worrying about the target browser.

Ext JS provides excellent performance. The framework is fully object oriented and extensible. Because it's written in the JavaScript language, Ext JS's features are ready to use after you download and install it.

Ext JS browser support:

The Ext JS framework is supported in all the major Web browsers, including:

* Windows® Internet Explorer® version 6 and later.
* Mozilla Firefox version 1.5 and later (PC and Macintosh).
* Apple Safari version 2 and later.
* Opera version 9 and later (PC and Mac).

Design patterns and Ext JS

Developers should appreciate the well-thought-out design and implementation of Ext JS. Its object-oriented design patterns influence the relationship and interactions between objects. According to Ext JS, the design patterns used in their development were highly influenced by the book, Head First Design Patterns, by Freeman and Freeman (see Resources). Developers looking at the Ext JS source code will find creational patterns, including the singleton design pattern; structural patterns, including the flyweight design pattern; and behavioral patterns, including the observer pattern.

Build rich Internet applications with Ext JS:

Ext JS provides numerous UI elements that are essential to developing rich Internet applications (RIAs). Ext JS includes controls such as message boxes, combo boxes, data grids, and toolbars. In addition, layout managers allow you to specify how elements are displayed on a page. Additional features are available for working with forms and windows.

The include order for the JavaScript files can change if you are using other frameworks. However, Ext JS is typically included in your Web application, assuming that you've installed Ext JS in the lib/ext directory on your Web server.

UI elements:

The heart of the Ext JS framework is the multitude of rich UI elements provided. These elements include forms, dialog boxes, tabs, trees, and grids.

Integration of Ext JS;
You can use Ext JS with other common Web development server-side frameworks, including PHP, the Java™ language, Microsoft® .NET, Ruby on Rails, and ColdFusion.

Ext JS and Ajax:

The Ext JS framework includes support for Ajax implementations. Typically, a common feature of Ajax applications is for an application to asynchronously respond to user input by updating the UI without redisplaying the entire Web page. A typical Ext JS Ajax implementation: an HTML text field and button element that posts data in the text field to a Web server when the button is clicked.

Ext JS integration with other Web server frameworks:

You can use Ext JS with other common Web development server-side frameworks, including PHP, the Java language, Microsoft .NET, Ruby on Rails, and ColdFusion. For integration specifics for each of these frameworks.

Ext JS development tools

You can integrate Ext JS framework development into several popular integrated development environments (IDEs), including Eclipse, Aptana, and Komodo. For information about including Ext JS development support in your IDE of choice.

Conclusion

Web development frameworks often promise to simplify and speed application development, but many fall short of that goal. Ext JS keeps its promise with an easy-to-use development model. The latest release of Ext JS — version 3.0 — shows that it is committed to evolving and remaining a cornerstone of RIA development.

EXTJS Life cycle:


Component Life Cycle
In general, the Component architecture in 2.0 will "just work." It's been designed to handle most of the management of components transparently to the end developer. However, there will come a time when something needs to be customized, or a Component needs to be extended. That's when a thorough understanding of the Component life cycle will become quite helpful. Following are the most important stages in the life cycle of every class based on Component:

1. Initialization:

The config object is applied
Classes that extend Component do not need to (and usually should not) provide a separate constructor. Component's constructor will not only apply any config passed into its subclasses, it also provides all of the following steps.

The base Component events are created
These are events that can be fired by any Component, and they are enable, disable, beforeshow, show, beforehide, hide, beforerender, render, beforedestroy, destroy (see the Component API docs for complete details).

The component is registered in ComponentMgr
As such it will always be available via Ext.getCmp.

The initComponent method is called
This is the most important initialization step for subclasses, as this is a template method intended to be implemented by each subclass to provide any needed constructor logic. The class being created is called first, and each class in the hierarchy back up to Component is expected to call superclass.initComponent. This method makes it easy to implement and, if needed, override the constructor logic at any step in the hierarchy.

Plugins are loaded (if applicable)
If this Component has any plugins specified in the config, they will be initialized at this time.

State is initialized (if applicable)
If the Component is state-aware, its state will be reloaded if available.

The component is rendered (if applicable)
The component is rendered immediately if either renderTo or applyTo is provided in the config, otherwise rendering is deferred until the Component is explicitly displayed in code or is told to render by its container.

2. Rendering:
The beforerender event is fired
This is a cancelable event, giving any handler the ability to prevent the Component from rendering if needed.

The container is set
If no container is specified, the parent node of the Component's underlying DOM element is set as the container.

The onRender method is called
This is the most important rendering step for subclasses, as this is a template method intended to be implemented by each subclass to provide the needed rendering logic. The class being created is called first, and each class in the hierarchy back up to Component is expected to call superclass.onRender. This method makes it easy to implement and, if needed, override the rendering logic at any step in the hierarchy.

The Component is "unhidden"
By default, many components are hidden using special CSS classes like "x-hidden". If the autoShow config value is true, any "hide" classes are removed from the component at this time.

Custom class and/or style applied
All Component subclasses support the special config properties of cls and style which are a custom, user-defined CSS class and rule respectively that will be applied to the DOM element underlying this Component. Specifying the cls value is the preferred method for visually customizing a Component and its constituent parts. Since the class will get applied to the topmost wrapper element of the Component's markup, any sub-elements of the Component can be adjusted using standard CSS inheritance rules.

The render event is fired
This is a notification that the Component has been successfully rendered at this point. You can safely assume that its DOM elements are now available to your code if needed. If you attempt to access a Component prior to rendering, it won't be available and you'll get an error.

The afterRender method is called
This is another template method for subclasses that can be implemented or overridden to provide any special post-rendering logic that may be needed. Each subclass is expected to call superclass.afterRender.

The Component is hidden and/or disabled (if applicable)
The hidden and disabled config values are applied at this point.

Any state-specific events are initialized (if applicable)
State-aware Components can declare special events that are specific to loading and saving state. If supplied, any such events will be added.

3. Destruction :
The beforedestroy event is fired
This is a cancelable event, giving any handler the ability to prevent the Component from being destroyed if needed.

The beforeDestroy method is called
This is another template method that can be implemented or overridden to provide any special pre-destruction logic that may be needed. Each subclass is expected to call superclass.beforeDestroy.

Element and its listeners are removed
If the Component has been rendered, its underlying Element's event listeners are removed and the Element itself is then removed from the DOM.

The onDestroy method is called
This is another template method that can be implemented or overridden to provide any special post-destruction logic that may be needed. Each subclass is expected to call superclass.onDestroy. Note that the Container class (and any Container subclasses) provides a default implementation of onDestroy that automatically loops through its items collection and calls destroy on each child Component recursively.

Component is unregistered from ComponentMgr
It will no longer be available via Ext.getCmp.

The destroy event is fired
This is simply a notification that the Component has been successfully destroyed at this point and is no longer available in the DOM.

Event listeners on the Component are removed
The Component itself can have event listeners separately from its underlying Element. If any exist, they are removed.
EXTJS:
Elements
Event Handling
Widget Examples
Application Layout/scope
Ext.extend

Element:
var div = Ext.get('myDiv');
div.setWidth(100);


Features of EXTJS


Quick tips
status bar
integration with google maps
Grids

Yes No cancel prompt
progress dialog
alert
icon dialog


Dialog
- dependent dialog
- independent
- splash

Layouts
Border Layout is drawn from nested layout panel.
- Border Layout
- Form Layout
- Anchor Layout --> flexible form resizing.
- Flow Layout --> Building of cool bar.

EXTJS components:
Form panel
Border layout
Form panel components:
combo box,textfield,html editor,numberfield
combo box:
select,change events
mode,lazyinit
grid panel:
colmodel,json reader,json store,simple store methods
cellclick,rowclick,click
grid selection models
tree panel:
node,event handlers

Difference between HTML and XHTML


- XHTML is built on XML technology so these codes can be placed directly in XML file.


HTML
- It's not hierarchical you can't spot a particular root. There may be different HTML groups.


Limitations
1. It's not fully furnished UI.SWT is 100% furnished UI but can't be implemented in web browser.
2.

JS
- 13 basic event handlers.
- 56 addons event handlers.
- Opacity --> animations

DOM 2.0
- stylist markup language
- structural markup language
- symantic markup language
- 100% object oriented
- Everything is an object in nature.
- There are 8 objects related to EXT JS from DOM
XMLDOMNodeList- It is a list of collection of objects based on condition.
DOMTree - It is required for hierarchy.


Factory methods
- Methods where production occurs during run time.
- Mass production happens.


Requirements for a simple EXT-JS
1.Call Ext-Base.js in a html file
2.This file should exist under webcontent/adapter/ext - Library is added.
3.Default stylesheet ext-all.css is avb under resources/css
4.Have your own js file link it under HTML file if required.
5.Helping js can also be called inside your HTML file.
6.Have layer to print your object. The layer is called Layer Dialog Area.
7.Use onReady() inside which object can be created and declared
8.Call the object with the EXT.get()
9.To open a window EXT.window() to set the properties and use show() to show the result in the monitor.

About EXTJS ver.2.2 :


- It is a framework.
- 100% client side implementation.
- It is used as a standardization of Java side implementation on client side.
- JS DOM and XML DOM are incorporated in EXT JS
- It is a part of Yahoo toolkit.
- It is used by other technologies apart from JAVA.
- ITs a widget which has its own lifetime so we can call but we can't control over the lifetime.

- It's a hierarchical if you hold the root tag you can traverse all the elements within it using getByElementId
- EXT.get('myElementId')
- 2 methods
- class method prefix the calling object with '.'
- Object method prefix the calling object with '#'
- Flyweight Design Pattern is a pattern which traverse the root object and collect all the wastes.
- SPECIFIC FLYWEIGHT when it is used for a single object.
- GLOBAL FLYWEIGHT when it is used for a multiple object.
- It reconstructs old object when it is required.
- 58 widgets are builtin out of which 36 are UI widgets.
- EXT.onReady is an eventhandler which is used to start the hierarchy of DOM structure.
- Node is a super object.




JSF (Java Server Faces)

- It is used for server side implementation
- It is used as a standardization of Java side implementation on server side.



steps:

2.ASP.jar and servlets.jar
3.Add core kernel JS files in the webcontent folder.Helping JS files are needed to be placed in the specific folders.
4.EXT js specific handlers needs to be used and inject your JS files into the core by using EXT JS authorized DOM's
5.Place your project in a necessary folders.

 


What is restrict option in directive?

The restrict option in angular directive, is used to specify how a directive will be invoked in your angular app i.e. as an attribute, class...