ext toolbar是否能换行布局的

appleIIappleII 2008-11-16
在toolbar中,如有很多textfield,和按钮时,它显示是一个整行,希望能换行来处理,不知道是否可以,谢谢!

				tbar: [
						'公司名称:',
						{xtype:'textfield',width:200,id:'sDepName',name:'sDepName'},{xtype:'tbseparator'},
						{text:'搜索',iconCls:'search',handler:searchClick},{xtype:'tbseparator'},  //iconCls是自定义中的css中说明的
						{text:'新增',iconCls:'add',handler:addClick},{xtype:'tbseparator'},
						{text:'查看',iconCls:'view',handler:viewClick},{xtype:'tbseparator'},
						{text:'编辑',iconCls:'post',handler:editClick},{xtype:'tbseparator'},
						{text:'删除',iconCls:'del',handler:delClick},{xtype:'tbseparator'},
						{text:'刷新',iconCls:'refresh',handler:function (){depDs.reload();}},{xtype:'tbseparator'}					
				      ],

hany 2008-11-17
我也有同样的问题,我在grid外弄一个form来做查询条件。感觉离grid太远了,布局不好看。也希望能直接用tbar。能用两行或多行
opmic 2010-02-26
问题一样,希望大牛出现。。。。。
Rooock 2010-02-26
LZ用了buttongroup吗?

将buttongroup扔在toolbar里, 你想多少行都可以
Relucent 2010-03-11
我是 Panel套了一个Grid ,没用原来的toolbar
liushihua71632 2010-03-15
好像论坛里面最近有个帖子介绍了解决楼主的方法 好像是用renderTo吧 忘记了
liushihua71632 2010-03-15
var tooltbar = new Ext.Toolbar({...});//自己写了
var hwtabs = new Ext.TabPanel({tbar:tooltbar,...});//随便写一个容器
var toolbbar = new Ext.Toolbar({renderTo : hwtabs.tbar});//自己写了
思路是这样的 能不能运行不知道了 反正在我的项目里面这样可以运行的
studyjava07 2010-04-15
你可以把grid先渲染后,然后再添加第二行的toolBar,这样就可以加上了

var grid = new Ext.grid.GridPanel({
....
});

tbar:[{...//你的第一行的toolbar}]
//然后
grid.render("example");
//然后再添加第二行的toolBar
//例如:
this.tb = new Ext.Toolbar({
renderTo:grid.tbar,
		
items:[{
...
}]


相互学习---共同提高
omegatong 2016-03-28
可以的,代码如下,胡乱弄个不好看,自己扩展吧
dockedItems: [{
        xtype: 'toolbar',
        items: [
                {xtype: 'fieldset', title: '对方单位',	 defaultType: 'textfield',layout: 'anchor',
	                defaults: {	anchor: '100%'},
	                items: [{labelWidth: 110,fieldLabel: '对方单位',name: 'dfdw3',	allowBlank: false  }, 
	                	    {xtype: 'container',layout: 'hbox', margin: '0 0 5 0',
	                    items: [{ labelWidth: 110,xtype: 'textfield', fieldLabel: '联系人', name: 'lxr', billingFieldName: 'billingCity', allowBlank: false }, 
	                            { xtype: 'textfield', fieldLabel: '联系电话', labelWidth: 80, margins: '0 0 0 5', name: 'lxdh' }]
	                }]
	            },
                {
            iconCls: 'icon-add',
            text: '查询',
            scope: this,
            //handler: this.onAddClick
        }, {
            iconCls: 'icon-delete',
            text: 'Delete',
            disabled: true,
            itemId: 'delete',
            scope: this,
            //handler: this.onDeleteClick
        }]}],

Global site tag (gtag.js) - Google Analytics