EditorGridPanel의 일부 속성, 구성 항목, 방법의 실례.창 크기에 적응

4403 단어 ext
페이지 정보:
grid = new Ext.grid.EditorGridPanel({
    	autoScroll:true,
        store: store,
        sm : new Ext.grid.RowSelectionModel(),
		cm: cm,
        renderTo: 'editor-grid',
        width: '100%',
        height: 600,
        autoWidth:true,
        autoExpandColumn: 'code', // column with this id will be expanded
        title: ' ',
        frame: true,//    
        viewConfig:{
			autoFill:true,
			sortAscText:' ',
			sortDescText:' ',
			columnsText:' '
		},
        clicksToEdit: 1,
        tbar:[{
              text: ' :'
           },{
              xtype: 'textfield',
              id: 'filter',
              selectOnFocus: true,
              width: 100,
              validationDelay:100,
              validator:function(){
              	store.load({
              		params:{
                       sorderId:this.getValue()// , 
                    }
              	});
              },scope:this
           }
        ]
    });

로드할 columnModel:
 
    var cm = new Ext.grid.ColumnModel({
        defaults: {
            sortable: true // columns are not sortable by default           
        },
        columns: [
            {
                id: 'code',
                header: ' ',
                dataIndex: 'code',
                width: 100
            }, {
                header: ' ',
                dataIndex: 'shortName',
                width: 100
             }, {
                header: ' ',
                dataIndex: 'ComSName',
                width: 100
             }, {
                header: ' ',
                dataIndex: 'style',
                width: 100
             }, {
                header: ' ',
                dataIndex: 'unitName',
                width: 40
             },{
                header: ' ',
                dataIndex: 'useCount',
                width: 100
             },{
                header: ' ',
                dataIndex: 'GCount',
                width: 100
             },{
                header: ' ',
                dataIndex: 'GPrice',
                width: 100
             },{
                header: 'sorderId',
                dataIndex: 'sorderId',
                width: 100
                hidden:true,
                                          // , 。
                hideable:false
                                       // 
             }
        ]
    });

로드할 store:
     var zlUrl=getRootPath()+'XXXServlet?change=stasksDetail';
     var store = new Ext.data.Store({
     	proxy: new Ext.data.HttpProxy({
             url: zlUrl
        }),
        reader: new Ext.data.JsonReader({
        	totalProperty: 'results',
            root: 'rows',
            fields: [
                {name: 'code', mapping: 'code'},
                {name: 'shortName'},
                {name:'ComSName'},
                {name: 'style'},
                {name: 'unitName'},
                {name:'useCount'},
                {name: 'GCount'},
                {name: 'GPrice'},
                {name:'sorderId'}
            ]
        })
    });

매개변수 전달 방법:
params:{
        sorderId:this.getValue()// , 
  }    
window.onresize = function(){ //  
 	grid.setWidth(0); 
        grid.setHeight(0); 
        grid.setWidth(Ext.get("content").getWidth()); 
        grid.setHeight(Ext.get("content").getHeight()); 
    };

좋은 웹페이지 즐겨찾기