Home arrow JavaScript arrow Page 4 - EXT JS Working With Live Data
JAVASCRIPT

EXT JS Working With Live Data


In a recent article we looked at the Date-Picker control from the world-class EXT-JS JavaScript library. In this article we’re going to be looking at a series of utilities and controls from the library which let you work with live data including the GridPanel, the PagingToolbar and the JsonReader components. These powerful tools can be combined in numerous ways to provide a robust solution to retrieving, formatting and displaying live data.

Author Info:
By: Dan Wellman
Rating: 5 stars5 stars5 stars5 stars5 stars / 3
July 20, 2009
TABLE OF CONTENTS:
  1. · EXT JS Working With Live Data
  2. · Starting the JavaScript
  3. · Defining the DataStore
  4. · Creating the GridPanel

print this article
SEARCH DEVARTICLES

TOOLS YOU CAN USE

advertisement
EXT JS Working With Live Data - Creating the GridPanel
(Page 4 of 4 )

Now that we have defined our JsonStore and ColumnModel, we need to create GridPanel itself; directly following the constructor method for our ColumnModel add the following chunk of code:


//define the grid

var grid = new Ext.grid.GridPanel({

el:"productGrid",

width:700,

height:500,

title:"Products",

store:dataStore,

cm:cm,

});


The GridPanel is defined in the same way as the other components, using a constructor and passing in a literal object used to define its properties. This time we use the Ext.data.GridPanel constructor.

We specify the el property, which tells the component the element on the page that we want the GridPanel rendered into. The value of this property is the id of our container element. The dimensions of the grid are specified with the width and height properties, and a title for the GridPanel is defined. We specify our JsonStore with the store property and our ContentModel using the cm property.

All we need to do now is render the grid and load the data; this can be achieved with the following code:


//render the grid

grid.render();

 

//load the data

dataStore.load();


These two simple commands bring the components that we’ve defined together to produce a working GridPanel, which should at this stage look something like this:


Summary

The basis of our page is complete using three related components of the EXT-JS library. Join me in part two of this example, where we’ll be adding the PHP file that produces the data, and enhancing the functionality of the GridPanel.

-DOWNLOAD SOURCE-


DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

blog comments powered by Disqus
JAVASCRIPT ARTICLES

- More Top jQuery Tutorials for Beginners
- More Top jQuery Plugins for Menus
- Top jQuery Tutorials for Beginners
- New UI Framework and SDK for JavaScript Rele...
- JavaScript OpenPGP Tool, Node.js 0.6.3 Avail...
- Yahoo Releases Cocktails Language and Develo...
- Customizing jQuery Slideshows: Dynamic Contr...
- Customizing jQuery Slideshows: the animate()...
- Customizing jQuery Slideshows: slideUp() and...
- Customizing jQuery Slideshows: hide() and sh...
- Web Workers: Performing Calculations in Para...
- More Top JavaScript Frameworks and Libraries
- More Dynamic jQuery Styling Techniques
- The Top JavaScript Libraries
- The Top JavaScript Frameworks

Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 



© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 3 - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials