Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/435.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 将ext.grid.panel添加到ext.form.panel时出错_Javascript_Jquery_Html_Extjs_Extjs4 - Fatal编程技术网

Javascript 将ext.grid.panel添加到ext.form.panel时出错

Javascript 将ext.grid.panel添加到ext.form.panel时出错,javascript,jquery,html,extjs,extjs4,Javascript,Jquery,Html,Extjs,Extjs4,我有这个网格和表格面板。我想在表单面板中添加一个数据网格,并且表单面板中仍然有按钮 myGrid= Ext.create('Ext.grid.Panel',{ layout: { type: 'fit' }, id: 'gridId', title: null, store: myDataStore, col

我有这个网格和表格面板。我想在表单面板中添加一个数据网格,并且表单面板中仍然有按钮

      myGrid= Ext.create('Ext.grid.Panel',{
            layout: {
                type: 'fit'
            },

            id: 'gridId',
            title: null,
            store: myDataStore,
            columns: [{
                header: 'header 1',
                dataIndex: 'index_1',
                width: 120
            }, {
                header: 'header 2',
                dataIndex: 'index_2',
                width: 120
            }, {
                header: 'header 3',
                dataIndex: 'index_3',
                width: 120
            }],
            stripeRows: true
        })

        formPanel= Ext.create('Ext.form.Panel',{
            id:'panelId',

            items:[myGrid],
            buttons: [{
                 // cancel, save, other buttons
            }]
        })
但是我得到了这个错误

HierarchyRequestError: Node cannot be inserted at the specified point in the hierarchy

我做错了什么?

您在
Ext.create()
config之后忘记了分号

在这里似乎很好用。我拉了把小提琴


我看不出此代码中有任何错误。我有工作样本: