帮助运行简单的ExtJS示例?

帮助运行简单的ExtJS示例?,extjs,Extjs,我下载了ExtJS4.0.2a,我正在尝试学习ExtJS教程。我使用“essentials”示例,因此我非常确定我的设置是正确的。我想在这里做一个网格示例 。。。但我无法显示网格 我的ExtStart.html如下所示: <html> <head> <title>Introduction to Ext 2.0: Starter Page</title> <!-- Include Ext and app-specific s

我下载了ExtJS4.0.2a,我正在尝试学习ExtJS教程。我使用“essentials”示例,因此我非常确定我的设置是正确的。我想在这里做一个网格示例

。。。但我无法显示网格

我的ExtStart.html如下所示:

<html>
<head>
    <title>Introduction to Ext 2.0: Starter Page</title>

    <!-- Include Ext and app-specific scripts: -->
    <script type="text/javascript" src="../adapter/ext/ext-base.js"></script>
    <script type="text/javascript" src="../ext-all-debug.js"></script>
    <script type="text/javascript" src="ExtStart.js"></script>

    <!-- Include Ext stylesheets here: -->
    <link rel="stylesheet" type="text/css" href="../resources/css/ext-all.css">
    <link rel="stylesheet" type="text/css" href="ExtStart.css">
</head>
<body>

    <div id="grid-example"></div>

</body>
</html>
Ext.onReady(function() {
    // sample static data for the store
    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']
    ];

    // create the data store
    var ds = new Ext.data.ArrayStore({
        fields: [
           {name: 'company'},
           {name: 'price', type: 'float'},
           {name: 'change', type: 'float'},
           {name: 'pctChange', type: 'float'},
           {name: 'lastChange', type: 'date', dateFormat: 'n/j h:ia'}
        ]
    });

    // manually load local data
    ds.loadData(myData);

    // create the colum Manager
    var colModel = new Ext.grid.ColumnModel([
            {header: 'Company', width: 160, sortable: true, dataIndex: 'company'},
            {header: 'Price', width: 75, sortable: true, dataIndex: 'price'},
            {header: 'Change', width: 75, sortable: true, dataIndex: 'change'},
            {header: '% Change', width: 75, sortable: true, dataIndex: 'pctChange'},
            {header: 'Last Updated', width: 85, sortable: true,
                renderer: Ext.util.Format.dateRenderer('m/d/Y'), dataIndex: 'lastChange'}
    ]);


    // create the Grid
    var grid = new Ext.grid.GridPanel({
        store: ds,
        colModel: colModel,
        height: 300,
        width: 600,
        title: 'My First Grid'
    });

    // render the grid to the specified div in the page
    grid.render('grid-example');
});
知道我做错了什么吗?伤心地被难住了(


rob

您使用的是ExtJS4,但所指的是遗留文档

在编写文档的版本和您正在使用的版本4之间,组件以及它们需要如何连接在一起已经有了相当多的更改

下面是ExtJS4的阵列网格(和其他)示例-



例如,您正在使用
Ext.grid.GridPanel
。这不再有效。(改为使用
Ext.grid.Panel

是的,Ext 2.0简介:入门页有点像是一个死赠品;)谢谢。我看到了版本号,但我只是假设,由于这些教程直接链接到Sencha的主页,它们仍然有效。他们为什么不更新呢?真令人沮丧。谢谢你的帮助!