Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/390.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 JS 3自动宽度柱网轴线_Javascript_Extjs - Fatal编程技术网

Javascript Ext JS 3自动宽度柱网轴线

Javascript Ext JS 3自动宽度柱网轴线,javascript,extjs,Javascript,Extjs,对不起, 如何在Ext JS 3的网格列中设置自动宽度? 这是我的代码,到目前为止: <script type="text/javascript"> Ext.onReady(function () { var mystore = new Ext.data.Store({proxy: new Ext.data.HttpProxy({url: 'info-extjs.php'}), reade

对不起, 如何在Ext JS 3的网格列中设置自动宽度? 这是我的代码,到目前为止:

<script type="text/javascript">
            Ext.onReady(function () {
                var mystore = new Ext.data.Store({proxy: new Ext.data.HttpProxy({url: 'info-extjs.php'}),
                    reader: new Ext.data.JsonReader({
                        root: 'guests',
                        fields: [{name: 'ip_address'},
                            {name: 'country'},
                            {name: 'region'},
                            {name: 'comp_name'},
                            {name: 'page'},
                            {name: 'timestamp'}]
                    })
                });
                //create the grid     
                var grid = new Ext.grid.GridPanel({
                    store: mystore,
                    title: 'Guest List of our blog',
                    columns: [{
                            id: 'ip_address',
                            header: 'IP Address',
                            autoSizeColumn: true, 
                            minWidth: 120,
                            sortable: true,
                            dataIndex: 'ip_address'
                        },
                        {
                            id: 'country',
                            header: 'Country',
                            autoSizeColumn: true, 
                            minWidth: 120,
                            sortable: true,
                            dataIndex: 'country'
                        },
                        {
                            header: 'region',
                            autoSizeColumn: true, 
                            minWidth: 120,
                            sortable: true,
                            dataIndex: 'region'
                        },
                        {
                            header: 'comp_name',
                            autoSizeColumn: true, 
                            minWidth: 120,
                            sortable: true,
                            dataIndex: 'comp_name'
                        },
                        {
                            header: 'page',
                            sortable: true,
                            dataIndex: 'page',
                            autoSizeColumn: true, 
                            minWidth: 150
                        },
                        {
                            header: 'timestamp',
                            sortable: true,
                            dataIndex: 'timestamp',
                            autoSizeColumn: true, 
                            minWidth: 150
                        }],
                    renderTo: 'guest-list-grid',

                    autoHeight: true
                });
                mystore.load();
            });
        </script>    
但是,不幸的是,它不起作用。图片如下: 请帮忙。Ext Js版本: ext-3.4.0

尝试添加到grids的viewconfig

...
renderTo: 'guest-list-grid',    
viewConfig: {
    forceFit: true
},

结果如下:图像链接:到多个空间。。如何,先生?将宽度添加到您的网格并检查一次。如果它不起作用,您可以始终在鼠标上方显示工具提示。如果我们设置宽度,则表示不是自动宽度。是否可以添加宽度:自动?我建议在像素中添加宽度,然后添加overflowX或autoscroll,这样您就可以获得滚动条。请检查一下,我们通常都是这样做的,但是。。ExtJS4能够自动调整列的大小。我正在寻找一种方法来实现ExtJS3.4。或者任何人的声明,请告诉我,如果这是不可能在ExtJS3.4与理性的原因,请让我知道。。
...
renderTo: 'guest-list-grid',    
viewConfig: {
    forceFit: true
},