View Full Version : [2.0a1][CLOSED] Ext.grid.Grid is not a constructor
Oberdan
4 Oct 2007, 8:01 AM
Hello All,
I'm just starting with ExtJS, so it can be a mistake. I was following the examples from the step-by-step tutorial, using the files from ExtIntro.zip (and ext-2.0-alpha1). All was working just fine, but the first grid example did not work, no grid showing.
With Firefox 2.0.0.7 (Win2k SP4) it gave me the error message:
Ext.grid.Grid is not a constructor
And did not work with IE6 SP1 (Win2k SP4) either...
Then I tried the same using ext-1.1.1, and the example worked just fine using both browsers. Is this a bug or am I doing something wrong? I checked the documentation and seems that all is OK...
Thanks,
Oberdan
jay@moduscreate.com
4 Oct 2007, 8:07 AM
Ext.grid.GridPanel
mystix
4 Oct 2007, 8:10 AM
the zip file included with the introductory tutorial is for Ext 1.1.1, and has most likely not been updated for the 2.0 alpha 1 release.
if you've simply replaced the paths in the tutorial download meant for Ext 1.1.1 with the equivalent paths in 2.0 alpha 1 without changing anything else, then you're likely to see errors during code execution.
you should compare the tutorial code (meant for Ext 1.1.1) with the code in the 2.0 alpha 1 grid samples to see what has changed between the two, and work from there.
p.s. have you read the Bug Forum guidelines?
Oberdan
4 Oct 2007, 8:32 AM
Hello,
I've just read the sample code for 2.0a1 Grids... :"> And yeah, I've read the Bug Forum guidelines, but maybe I should do it again, paying more attention this time. And maybe I should start working on an updadated version of the introductory tutorial. :D
Thanks.
mystix
4 Oct 2007, 9:03 AM
And maybe I should start working on an updadated version of the introductory tutorial. :D
looking forward to it ;)
wormcc
13 Oct 2007, 8:18 PM
looking forward to it ;)
I added a note and the updated line of code into the tutorial. It took me a while to find this post and the solution. I just hope the note and the code will save others some time. :)
mystix
13 Oct 2007, 10:00 PM
I added a note and the updated line of code into the tutorial. It took me a while to find this post and the solution. I just hope the note and the code will save others some time. :)
thanks :)
osoto3
26 Mar 2008, 6:10 AM
I added a note and the updated line of code into the tutorial. It took me a while to find this post and the solution. I just hope the note and the code will save others some time. :)
Hi, I am new to this forum and I am looking for the solution to this problem. Can you provide me with a link or point me to the location or explanatoin of the solution? Thanks.
scubby
26 Mar 2008, 12:22 PM
I downloaded and copied the ExtJS files to my web site, and ran through the introductory tutorial (trying to get a grid on the screen), and it's coming up with this error:
"Ext.grid.Grid is not a constructor"
What do I do? I tried searching, but the responses to the problem didn't work.
Code is below.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Sales</title>
<link rel="stylesheet" type="text/css" href="/ext/resources/css/ext-all.css">
<script type="text/javascript" src="/ext/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="/ext/ext-all-debug.js"></script>
<script type="text/javascript">
Ext.onReady(function()
{
var page = Ext.get("Page");
var myData = [
['Apple',29.89,0.24,0.81,'9/1 12:00am'],
['Ext',83.81,0.28,0.34,'9/12 12:00am'],
['Google',71.72,0.02,0.03,'10/1 12:00am'],
['Microsoft',52.55,0.01,0.02,'7/4 12:00am'],
['Yahoo!',29.01,0.42,1.47,'5/22 12:00am']
];
var ds = new Ext.data.Store({
proxy: new Ext.data.MemoryProxy(myData),
reader: new Ext.data.ArrayReader({id: 0}, [
{name: 'company'},
{name: 'price', type: 'float'},
{name: 'change', type: 'float'},
{name: 'pctChange', type: 'float'},
{name: 'lastChange', type: 'date', dateFormat: 'n/j h:ia'}
])
});
ds.load();
var columnModel = new Ext.grid.ColumnModel([
{header: "Company", width: 120, sortable: true, dataIndex: 'company'},
{header: "Price", width: 90, sortable: true, dataIndex: 'price'},
{header: "Change", width: 90, sortable: true, dataIndex: 'change'},
{header: "% Change", width: 90, sortable: true, dataIndex: 'pctChange'},
{header: "Last Updated", width: 120, sortable: true, dataIndex: 'lastChange', renderer: Ext.util.Format.dateRenderer('m/d/Y')}
]);
var grid = new Ext.grid.Grid(page,
{ds: ds, cm: columnModel});
grid.render();
grid.getSelectionModel().selectFirstRow();
});
</script>
</head>
<body>
<div id="Page"></div>
</body>
</html>
brian.moeskau
26 Mar 2008, 12:25 PM
If you are using 2.0, it's Ext.grid.GridPanel. Looks like you are using an old copy of the tutorial?
scubby
26 Mar 2008, 12:41 PM
Tried GridPanel, it gives me:
cm has no properties
brian.moeskau
26 Mar 2008, 12:55 PM
Changing one line will not upgrade your code to 2.0 :)
Are you using the 2.0 version of the tutorial? Look at the code here: http://extjs.com/learn/Tutorial:Introduction_to_Ext_2.0#Grid
alibaba69
12 Nov 2008, 7:47 AM
I had the same problem and I fixed with this.
Thanks a lot :)
Powered by vBulletin® Version 4.1.5 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.