javascript - Gridpanel 没有在 Ext js 4.0.7 的视口(viewport)内显示我的代码有什么问题

标签 javascript html css extjs

我的代码:

 //view port start here dont know where am wrong??
    Ext.create('Ext.container.Viewport', {
      layout: 'border',
     // autoRender:false,
         items: [  {
            region: 'east',
            title: 'Display Selected Frames',
            collapsible: true,
            split: true,
            width: 150
        }, {
            Xtype:'gridPanel',
            title:'Select Parameter and values To Upload in Sheet2',
            region: 'center',
            autoWidth:true,
            autoHeight:true,
           store: store,
          //store:Ext.data.StoreManager.lookup('store'),
          RenderTo:'grid-example',
                 columns: [{
                dataIndex: 'Parameter Name',
                flex: 1,
                text: 'Parameter Name',
                hideable: false,
                 sortable:false
            },
            {
            dataIndex: 'Value1',
            flex: 1.5,
            text: 'Value1',
            hideable: false,
            sortable:false
        }, {
            dataIndex: 'Value2',
            flex: 1.2,
            text: 'Value2',
            hideable: false,
            sortable:false
            }],
            columnLines: true,
            selModel: selModel,
            stripeRows: true,
            frame:true,
            resizable: {
                handles: 's'  
            },
            bbar: Ext.create('Ext.PagingToolbar', {
                pageSize: 10,
                store: store,
                displayInfo: true,
                plugins: Ext.create('Ext.ux.SlidingPager', {})
            }),
            //docueditem are displaying but grid is not displaying

最佳答案

固定代码:

{
    // There is no property `Xtype`, but `xtype`
    // There is no xtype (alias) `gridPanel`, but `gridpanel`
    xtype: 'gridpanel',
    title: 'Select Parameter and values To Upload in Sheet2',
    region: 'center',
    autoWidth: true,
    autoHeight: true,
    store: store,
    // There is no property `RenderTo`, but `renderTo`
    // Also, from the docs for renderTo:
    // "Do not use this option if the Component is to be a child item of a Container. It is the responsibility of the Container's layout manager to render and manage its child items."
    // Thanks Evan Trimboli for pointing on it
    // renderTo: 'grid-example',
    columns: [
        {
            dataIndex: 'Parameter Name',
            flex: 1,
            text: 'Parameter Name',
            hideable: false,
            sortable: false
        },
        {
            dataIndex: 'Value1',
            flex: 1.5,
            text: 'Value1',
            hideable: false,
            sortable: false
        },
        {
            dataIndex: 'Value2',
            flex: 1.2,
            text: 'Value2',
            hideable: false,
            sortable: false
        }
    ],
    columnLines: true,
    selModel: selModel,
    stripeRows: true,
    frame: true,
    resizable: {
        handles: 's'
    }
}

关于javascript - Gridpanel 没有在 Ext js 4.0.7 的视口(viewport)内显示我的代码有什么问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34036758/

相关文章:

javascript - 用已知位置替换多个字符串

javascript - 在更新面板的部分回发后执行 javascript?

html - 文本对齐:证明在表 td 中不起作用

javascript - 如何根据特定字符进行自动换行?

java - 如何将 HTML 标签与 Java 字符串一起添加?

javascript - HTML5 Canvas : Change Image Color

jquery - 如何访问css效果,在类的jquery函数调用中

javascript - 如何通过setInterval设置div元素的图片背景?

javascript - 使用 JavaScript 更改嵌套 HTML 元素的字体颜色

javascript - 使用 jQuery 检测何时在 div 中单击按钮