FitLayout详解编程语言

<HTML>  
<HEAD>  
<TITLE>布局</TITLE>  
<link rel="stylesheet" type="text/css" href="Ext/resources/css/ext-all.css" />  
<script type="text/javascript" src="Ext/ext-base.js"></script>  
<script type="text/javascript" src="Ext/ext-all.js"></script>  
<script type="text/javascript" src="Ext/ext-lang-zh_CN.js" charset="utf-8"></script>  
</HEAD>  
<script type="text/javascript">  
    Ext.onReady(function(){ 
        var store = new Ext.data.SimpleStore({ 
            fields: ['id', 'name', 'desc'], 
            data: [ 
                ['1', 'name1', 'desc1'], 
                ['2', 'name2', 'desc2'], 
                ['3', 'name3', 'desc3'], 
                ['4', 'name4', 'desc4'], 
                ['5', 'name5', 'desc5'], 
                ['6', 'name6', 'desc6'], 
                ['7', 'name7', 'desc7'], 
                ['8', 'name8', 'desc8'], 
                ['9', 'name9', 'desc9'], 
                ['10', 'name10', 'desc10'] 
            ] 
        }); 
        var grid = new Ext.grid.GridPanel({ 
            title: 'grid', 
            viewConfig: {forceFit: true}, 
            store: store, 
            columns: [ 
                {header:'id', dataIndex: 'id'}, 
                {header:'名称', dataIndex:'name'}, 
                {header:'描述', dataIndex:'desc'} 
            ], 
            tbar: new Ext.Toolbar(['添加','修改','删除']), 
            bbar: new Ext.PagingToolbar({ 
                pageSize: 15, 
                store: store 
            }) 
        }); 
        //grid.store.load(); 
 
        var viewport = new Ext.Viewport({ 
            layout: 'fit', 
            items: [grid] 
        }); 
    }); 
</script>  
<BODY>  
    <script type="text/javascript" src="Ext/examples/shared/examples.js"></script> 
</BODY>  
</HTML>

 

原创文章,作者:Maggie-Hunter,如若转载,请注明出处:https://blog.ytso.com/industrynews/13247.html

(0)
上一篇 2021年7月19日 15:37
下一篇 2021年7月19日 15:37

相关推荐

发表回复

登录后才能评论