ExtJS 3.4 GridPanel不在FormPanel内显示

时间:2012-10-06 04:07:35

标签: javascript extjs formpanel

我正在尝试修改示例代码以构建类似的表单 http://dev.sencha.com/deploy/ext-4.1.0-gpl/examples/form/form-grid.html

我的代码如下:

    var references = new Ext.form.FormPanel({
    frame: true,
    title: 'References',
    bodyPadding: 5,
    layout: 'column',
    fieldDefaults: {
        labelAlign: 'left',
        msgTarget: 'side'
    },
    items: [{
        columnWidth: 0.60,
        xtype: 'gridpanel',
        store: reference_store,
        height: 400,
        title:'General',
        columns: [
          { id: 'name', header : 'Reference', flex: 1, sortable : true, dataIndex: 'reference' },
          { header: 'Impact', width : 75, sortable : true, dataIndex: 'impact'},
       ]
    }, {
        columnWidth: 0.4,
        margin: '0 0 0 10',
        xtype: 'fieldset',
        title:'Details',
        defaults: {
            width: 240,
            labelWidth: 90
        },
        defaultType: 'textfield',
        items: [{fieldLabel: 'Name', name: 'reference'}]
    }]
});

但整个FormPanel未能显示。当我用'fieldset'或其他类型替换'gridpanel'时,无论格式是否错误,FormPanel都会出现。

1 个答案:

答案 0 :(得分:2)

xtype应该是“grid”而不是“gridpanel”