Home arrow JavaScript arrow Page 2 - EXT JS Passing Live Data
JAVASCRIPT

EXT JS Passing Live Data


Welcome to part two of the EXT-JS live data tutorial. In part one we created the underlying page and added the code to create the JsonStore, ColumnModel and GridPanel. Our GridPanel, however, currently has no data, so the first thing we’re going to do in this part of the tutorial is add the PHP code that will pass this data back to the JsonStore.

Author Info:
By: Dan Wellman
Rating: 3 stars3 stars3 stars3 stars3 stars / 3
July 27, 2009
TABLE OF CONTENTS:
  1. · EXT JS Passing Live Data
  2. · MySQL
  3. · Adding Additional Configuration Properties
  4. · Working More Closely with the Back End

print this article
SEARCH DEVARTICLES

TOOLS YOU CAN USE

advertisement
EXT JS Passing Live Data - MySQL
(Page 2 of 4 )

Your database and the example table will already need to be set up with the correct fields and data types. The following commands at the MySQL Command Line Interface (CLI) can be used to achieve this:


CREATE DATABASE shop;


USE shop;


CREATE TABLE products (title VARCHAR(40), image VARCHAR(40), inStock ENUM(‘y’, ‘n’), price DECIMAL(5,2), category VARCHAR(20), manufacturer VARCHAR(20));


Each command should go on its own line, and the enter key should be pressed after each line. We define each of the fields in the table, mostly using standard characters of differing lengths (VARCHAR). We also define the inStock field using ENUM, which is synonymous for a Boolean value, and the DECIMAL type, which gives more accurate financial rounding. With this type we specify the total number of figures with the first integer and the number of decimal places with the second.

Unless you happen to have a table stuffed full of product information, you’re going to need to add the data used in this example to your database. You could do this manually, but as we’re using approximately 40 products for this example, that could take some time. I’ve created a text file which can be used to add the required data to the database automatically, which should be included with the code download for this tutorial. All you need to do to use this file is run the following command in the MySQL CLI:


LOAD DATA LOCAL INFILE 'c:/pathTo/stockList.txt' INTO TABLE products LINES TERMINATED BY '\r\n';


Now that we have the data in our database and have the PHP file ready to pass the data back to our JsonStore, the GridPanel should be populated when the page is opened, as in the following screen shot:




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 5 - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials