日期:2014-05-16 浏览次数:20813 次
Ext.onReady(function(){ Ext.BLANK_IMAAGE_URL ='../ext/resources/images/default/s.gif'; Ext.QuickTips.init(); Ext.form.Field.prototype.msgTarget = 'side'; var p = new Ext.Panel({ title: 'My Panel', collapsible:true, renderTo: 'User_InfoMange', width:400, html:'<font color=blue>asdflkj<br/> aslkdfj <br/>lkajs lkfj<br/> alskdj f<br/></font>', buttonsAlgin:'center', // config:{ // buttonsAlgin:'center' // }, tbar:[ ] }); for(var i=0;i<50;i++){ p.getTopToolbar().add(new Ext.Toolbar.Spacer()); } p.getTopToolbar().add({text:"显示"}); });
------解决方案--------------------
试试这个,关键就在于'->',这是tbar里是按钮居右的符号,就像'-'是分隔符一样。
tbar:[{ xtype:"label", text:"管理员:" },{ xtype:"label", text:Cookies.get("LogName") },'->',{ xtype:"tbbutton", id:"button_password", text:"password", handler:function(){ if(!win_password) { win_password = CreateWindow({ el:"win_password", title:"修改密码", items:CreateFormPanel(form_passwordConfig) }); } win_password.show("button_password"); } },'-',{ xtype:"tbbutton", id:"button_reg", text:"register", handler:function(){ if(!win_reg) { win_reg = CreateWindow({ el:"win_reg", title:"修改密码", items:CreateFormPanel(form_regConfig) }); } win_reg.show("button_reg"); } },'-',{ xtype:"tbbutton", text:"logout", handler:function(){ Ext.MessageBox.confirm("警告","您确定要注销吗?",function(button){ if(button == "yes") { window.location = "../Default.aspx"; } }); } }]