Ext.GridPanel 높이가 지정된 높이보다 크면 수직으로 스크롤되고 지정된 높이보다 작으면 자동으로 적응됩니다.

1907 단어 ext
grid_taskQueryPop = new Ext.grid.GridPanel({ 
	        applyTo: 'search-panel',
	        title:'',
	        store: store_taskQueryPop,
	        cm: cm_taskQueryPop,
	        sm: query_sm, //new Ext.grid.RowSelectionModel({singleSelect:true}),
	        width: 500,
	        //autoHeight: true,
	        height: 290,	//10 ;
	        //maxHeight: 290,
	        view: new Ext.grid.GridView({
				forceFit:true
			}),
	        tbar: [
	        	//' ',
	        	//{xtype: 'checkbox', boxLabel: '  ' + TagCharacterTask.SELECT_ALL, id: 'selectAll'},
	        	'     ',
	        	TagCharacterTask.SELECT_BY_NAME_COLON,
	            {xtype: 'textfield', id: 'queryConTextId'},
	            {xtype: 'button', text: TagCharacterTask.SALE_TASK_SEARCH, iconCls: 'searchTask', handler: searchCheckBox}
	        ],
	        bbar: new Ext.PagingToolbar({ 
		        pageSize: pageCount, 
		        store: store_taskQueryPop, 
		        displayInfo: true, 
		        displayMsg: CommonRes.BBAR_TEXT, 
		        emptyMsg: CommonRes.NO_RECORD
		    })
	    });

 
store_taskQueryPop.on("load", function(tis, records, opt){
	    	if(records.length < 10){// 10 
	    		var frameHeight = grid_taskQueryPop.getFrameHeight();
	    		var innerHeight = grid_taskQueryPop.getEl().select('div.x-grid3-body');
	    		//alert(innerHeight.first().getHeight());
	    		grid_taskQueryPop.setHeight(innerHeight.first().getHeight() + frameHeight + 26);
	    		grid_taskQueryPop.syncSize();
	    	}
}
 
 

좋은 웹페이지 즐겨찾기