-1

我很难学习 ExtJS。尽管几乎在所有地方都提到它与 DOJO 等其他产品相比是最简单的。
我试图创建的是一棵简单的树(没有 MVC .. 只是一棵简单的树)。这是我的javascript代码..

 Ext.create('Ext.tree.Panel', {
            renderTo: Ext.getBody(),
            title: 'Simple Tree',
            width: 150,
            height: 150,
            root: {
                text: 'Root',
                expanded: true,
                children: [
                    {
                        text: 'Child 1',
                        leaf: true
                    },
                    {
                        text: 'Child 2',
                        leaf: true
                    },
                    {
                        text: 'Child 3',
                        expanded: true,
                        children: [
                            {
                                text: 'Grandchild',
                                leaf: true
                            }
                        ]
                    }
                ]
            }
        }); 

并且只有像面板这样的东西被渲染在身体上。html是这个

<body>
    <div>

    </div>
</body>

我究竟做错了什么?
更新:-
1.此处的整个 javascript 都放置在页面中 body 标记之后。
2. 我包括与 ExtJS 下载捆绑的 bootstrap.js jsvascript 文件。

4

1 回答 1

0

Ext.create()函数应该在内部调用,Ext.onReady()否则会渲染一些元素而其他元素不会

于 2012-06-13T12:14:09.090 回答