Vlad
Vlad

Reputation: 2773

Error when adding ext.grid.panel into ext.form.panel

I have this grid and form panels. I want to add a grid of data into the form panel and still have buttons from the form panel.

      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
            }]
        })

But I get this error

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

what do I do wrong?

Upvotes: 0

Views: 755

Answers (1)

Johan Haest
Johan Haest

Reputation: 4421

You forgot semicolons after your Ext.create() config.

Seems to work just fine here. I made a fiddle

http://jsfiddle.net/WGgR8/1/

Upvotes: 1

Related Questions