Ext 오프닝 레이아웃 설계 Viewport

8784 단어 viewport
// dwr

dwr.engine.setAsync(false);









//*************************************** **************************************************





var store = new Ext.data.ArrayStore({

        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,

        height:300,

        columns: [

            {header:'id', dataIndex: 'id'},

            {header:' ', dataIndex:'name'},

            {header:' ', dataIndex:'desc'}

        ],

        tbar: new Ext.Toolbar([' ',' ',' ']),

        bbar: new Ext.PagingToolbar({

            pageSize: 15,

            store: store

        })

    });







    

    

    

  //*************************************** function ****************************************************

      

      





    

    

    

    

//  *****************************************************************************************************

//  Ext.onReady





//  ******************** A:viewport***************************

//Ext.onReady(function(){

//

//// A:viewport

//    var viewport = new Ext.Viewport({

//        layout: 'border',

//        items: [

//            {region:'north',html:'north',title:'north',height:80},

//            

//            {region:'west',title:'west',width:300,

//                items:

//                    [grid,

//                       {region:'center',html:'center2html',title:'center2',autoHeight:true}]

//            },

//            

//            {region:'center',html:'center',title:'center'}

//        ]

//    });

//});





//******************** B:viewport totalPanel tbar***************************



Ext.onReady(function(){

    

// B:viewport totalPanel

        var totalPanel = new Ext.Panel({

                //width:400,

                region:'center',

                tbar: new Ext.Toolbar(['viewport PlanB']),    // tbar 

                //tbarCfg :{height:200},

                //renderTo: Ext.getBody(),

                //height:640,

                border :false,

                split:true,

                id:'fp1',

                layout:'border',

                //enableTabScroll:true,        

                items: [

                        

                        {region:'north',html:'north',title:'north',height:80},

                        

                        {region:'west',title:'west',width:300,

                            items:

                                [grid,

                                   {region:'center',html:'center2html',title:'center2',autoHeight:true}]

                        },

                        

                        {region:'center',html:'center',title:'center'}

                        

                    ]

    

        });

    

    

// B:viewport

        var viewport = new Ext.Viewport({

            layout: 'border',

            items: totalPanel

        });

        

//        //  

//        loadGridData() ;

//        loadGrid2Data() ;

//        loadGrid3Data() ;

    

});

좋은 웹페이지 즐겨찾기