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之后忘记了分号
在这里似乎很好用。我拉了把小提琴
我看不出此代码中有任何错误。我有工作样本: