Sunday, December 9, 2012
ExtJS 4–Data Framework–Models-Association–Part 3
The models can be associated to create complex data model. Both single values and multi valued association can be defined in Ext Data framework. The association are defined using “associations” configuration in model. Lets take for example we have Person and Address model. The association is that Person has multiple address (Shipping, billing etc.). The code snippet below describes...
ExtJS 4–Data Framework–Models-Validation–Part 2
Continuing from previous post. Lets add some validation to the model. Data validation can be specified in models through the validations configuration array. Validation available are presence Field has to have a value. Empty strings are not valid. Zero (0) is valid length...
ExtJS 4–Data Framework–Models–Part 1
In this post, we will be defining a Model and then we will define model and then validations on that. The class to extend is “Ext.data.Model”. Ext.define('Training.model.Person', { extend:'Ext.data.Model', fields:[ { name:'firstname', type:'string' }, { name:'lastname', type:'string' }, { ...
ExtJS 4–Data Framework
The three mail components in Data framework are Model Store Proxy The model class is the new and most important class in Ext.data package. It is the improvement over Record class in Ext 3.x. Now, we can represent real entities using Model classes. Now, proxy can be attached...
ExtJS 4–Events–Context Menu
In this post, we will try to add a context menu for the div. Let see the output first. When we right-click inside the div, we are showing the context menu. Lets see the code for this. We are using ExtJS menu (Ext.menu.Menu) instance for this. Let see the code for this. var myMenu...
Saturday, December 8, 2012
ExtJS 4–Dom Handling–Events
ExtJS core provides a excellent support for attaching event handler for Dom Element events. For example. We can suppress the default right click context menu on browser and show our ExtJS menu, capture click listener for buttons, mouse over events for any element. Lets see a click event getting attached to button. We will use the code from previous code. We will remove the onclick...
Ext JS 4–DOM Handling
ExtJS has core framework which helps in dom handling and event management. The main class is Element class which is ExtJS wrapper around the dom nodes. There are ExtJS utilities to select and manipulate the Dom elements. The Element class normalizes the DOM manipulation and provides positioning capabilities. There are two way to get the Element Ext.get(id) Ext.fly(id). Both method...
Subscribe to:
Posts (Atom)