`

GridPanel随窗口大小变化而变化

 
阅读更多

使用viewport布局,左侧(west)是一棵树,右侧(center)是用户数据区,

在左侧树收缩时,右侧的gridpel跟随窗口变化而变化。

代码如下:

var tree_type_grid = new Ext.grid.GridPanel({
					id : 'tree_type_grid',
					store : treeTypeStore,
					layout:'fit',
					//renderTo:'tree_type_choose',
					renderTo:Ext.getBody(),
					colModel : colmodel,
					selModel : new Ext.grid.RowSelectionModel(),
					stripeRows : true,
					//height : 490,
					//height : '100%',
					width:'100%',
					autoScroll:false,
					sm:rsmodel,
					tbar : topBar,
					bbar : pagingBar
				});

 

效果如下:

 添加如下代码:

Ext.EventManager.onWindowResize(function(){
	tree_type_grid.getView().refresh();
	});

 效果如下:

 

 本方法对ExtJS3.0.0有效,其它未验证。

  • 大小: 18.2 KB
  • 大小: 19.3 KB
  • 大小: 12.7 KB
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics