extjs 创建了一个formPanel作为一个gridpanel的Tbar 在多个Tab的情况下,formPanel的布局会变得混乱
formPanel代码:varsearchPanelR=newExt.FormPanel({height:40,//frame:true,id:'receiveSearc...
formPanel代码:
var searchPanelR=new Ext.FormPanel({
height:40,
// frame:true,
id:'receiveSearchForm',
frame:false,
border:false,
layout : 'hbox',
layoutConfig:{padding:"5",
align:"middle"
},
defaults : {
xtype : 'label',
margins:{top:0,right:4,bottom:4,left:4}
},
url:_ctx.base+'/info/listShortMessage.do',
items:[
{
text : '类型'
},{
xtype : 'combo',
store : msgTypeStore,
displayField : 'vl',
valueField : 'id',
hiddenName : 'typeid',
editable : false,
triggerAction : 'all'
}, {
text : '发送人'
}, {
xtype : 'textfield',
name : 'shortMessage.sender'
},{
text:'从'
}
,{
xtype:'datefield',
format:'Y-m-d',
name:'from',
editable : false
},
{
text:'到'
},
{
xtype:'datefield',
format:'Y-m-d',
name:'to',
editable : false
},{
text:'查询',
iconCls:'search',
xtype : 'button',
handler:function(){
var receiveGrid = Ext.getCmp('ReceiveMessage');
searchPanelR.getForm().submit({
waitMsg:'正在提交查询信息',
success: function(searchPanelR, action){
var receiveStore = receiveGrid.getStore();
var rsText=action.response.responseText.replace('success:true,',"");
var result=Ext.util.JSON.decode(rsText);
receiveStore.loadData(result,false);
},
failure:function(searchPanelR, action){
alert('something wrong');
}
});
}
},{
text:'重置',
xtype : 'button',
iconCls:'reset',
handler:function(){
searchPanelR.getForm().reset();
}
},{
text:'标记为已读',
xtype : 'button',
iconCls:'btn-readed',
handler:function(){
searchPanelR.getForm().reset();
}
},{
iconCls : 'btn-del',
text : '删除信息',
xtype : 'button',
handler : function() {
var grid=Ext.getCmp("ReceiveMessage");
var selectRecords=grid.getSelectionModel().getSelections();
if(selectRecords.length==0){
Ext.Msg.alert("信息","请选择要删除的记录!");
return;
}
var ids=Array();
for(var i=0;i<selectRecords.length;i++){
ids.push(selectRecords[i].data.roleId);
}
MessageView.removeReceiveMessage(ids);
}
}
]
});
在刷新后页面就变成这样了 展开
var searchPanelR=new Ext.FormPanel({
height:40,
// frame:true,
id:'receiveSearchForm',
frame:false,
border:false,
layout : 'hbox',
layoutConfig:{padding:"5",
align:"middle"
},
defaults : {
xtype : 'label',
margins:{top:0,right:4,bottom:4,left:4}
},
url:_ctx.base+'/info/listShortMessage.do',
items:[
{
text : '类型'
},{
xtype : 'combo',
store : msgTypeStore,
displayField : 'vl',
valueField : 'id',
hiddenName : 'typeid',
editable : false,
triggerAction : 'all'
}, {
text : '发送人'
}, {
xtype : 'textfield',
name : 'shortMessage.sender'
},{
text:'从'
}
,{
xtype:'datefield',
format:'Y-m-d',
name:'from',
editable : false
},
{
text:'到'
},
{
xtype:'datefield',
format:'Y-m-d',
name:'to',
editable : false
},{
text:'查询',
iconCls:'search',
xtype : 'button',
handler:function(){
var receiveGrid = Ext.getCmp('ReceiveMessage');
searchPanelR.getForm().submit({
waitMsg:'正在提交查询信息',
success: function(searchPanelR, action){
var receiveStore = receiveGrid.getStore();
var rsText=action.response.responseText.replace('success:true,',"");
var result=Ext.util.JSON.decode(rsText);
receiveStore.loadData(result,false);
},
failure:function(searchPanelR, action){
alert('something wrong');
}
});
}
},{
text:'重置',
xtype : 'button',
iconCls:'reset',
handler:function(){
searchPanelR.getForm().reset();
}
},{
text:'标记为已读',
xtype : 'button',
iconCls:'btn-readed',
handler:function(){
searchPanelR.getForm().reset();
}
},{
iconCls : 'btn-del',
text : '删除信息',
xtype : 'button',
handler : function() {
var grid=Ext.getCmp("ReceiveMessage");
var selectRecords=grid.getSelectionModel().getSelections();
if(selectRecords.length==0){
Ext.Msg.alert("信息","请选择要删除的记录!");
return;
}
var ids=Array();
for(var i=0;i<selectRecords.length;i++){
ids.push(selectRecords[i].data.roleId);
}
MessageView.removeReceiveMessage(ids);
}
}
]
});
在刷新后页面就变成这样了 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询