PDA

View Full Version : Grid Problem



aklahiri
1 Jan 2010, 10:48 AM
Hello,

I have a situation regarding the Grid. Please let me know whats wrong with my following lines of coding.

<html>
<head>
<title>Grid</title>
<link rel="stylesheet" type="text/css" href="../extjs/resources/css/ext-all.css" />
<script type="text/javascript" src="../extjs/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="../extjs/ext-all.js"></script>
<script>
Ext.onReady(function(){
var store = new Ext.data.Store({
data:
[
[ 1, "Office Space", "Mike Judge", "02/19/1990", 1, "Work Sucks" ],
[ 2, "Super Troopers", "Jay Chandrasekhar", "02/15/2002", 1, "Altered State Police" ]
],
reader: new Ext.data.ArrayReader({id:'id'},
[ 'id', 'title', 'director', {name: 'released', type: 'date', dateFormat: 'm/d/Y'}, 'genre', 'tagline' ]
});

// add your data store here
var grid = new Ext.grid.GridPanel({
renderTo: Ext.getBody(), //document.body,
frame:true,
title: 'Movie Database',
height:200,
width:500,
store: store,
columns:
[
{header:"Title", dataIndex:'title'},
{header:"Director", dataIndex:'director'},
{header:"Released", dataIndex:'released', renderer: Ext.util.Format.dateRenderer('m/d/Y')},
{header:"Genre", dataIndex:'genre'},
{header:"Tagline", dataIndex:'tagline'}
]
});
});
</script>
</head>

</html>

Please help.

Thanks & Regards.

cerad
1 Jan 2010, 5:42 PM
Load up firebug and look at the console. And get yourself a syntax color coding editor. Missing a left paren in your store.



var store = new Ext.data.Store({
data:
[
[ 1, "Office Space", "Mike Judge", "02/19/1990", 1, "Work Sucks" ],
[ 2, "Super Troopers", "Jay Chandrasekhar", "02/15/2002", 1, "Altered State Police" ]
],
reader: new Ext.data.ArrayReader({id:'id'},
[ 'id', 'title', 'director', {name: 'released', type: 'date', dateFormat: 'm/d/Y'}, 'genre', 'tagline' ]
) // Missing left paren
});

aklahiri
2 Jan 2010, 9:02 AM
Hello cerad,

Thanks a lot for the kind reply and help me to find out the solution.

I will be obliged if you kindly reply on my following queries.

1. How do I get a good editor to write Ext programs ?
2. How to grab the Ext JS quickly ? Is there any good sites / tutorials ?
3. How to install Firebug in a browser which is not connected with the internet ?

I will look forward to your kind reply.

Thanks & Regards.

Condor
2 Jan 2010, 10:08 AM
1. Read this (http://www.extjs.com/blog/2008/02/01/ides-plugins-and-tools-for-ext-js-20/).
2. Read this (http://www.extjs.com/blog/2009/03/16/ext-js-books/).
3. Download the .xpi file and execute it on the PC without internet connection.