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>

 

posted @ 2013-08-26 10:34 残星 阅读(...) 评论(...) 编辑 收藏