代码如下:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
templateAdmin
Ext.onReady(function(){
Ext.BLANK_IMAGE_URL = '../../resource/images/s.gif';
Ext.addForm = new Ext.form.FormPanel({
region:'center',
bodyStyle:'padding-top:65px; padding-left:130px;',
labelWidth:40,
labelAlign:'right',
frame:true,
items:[
{
xtype:'textfield',
fieldLabel:'模板',
id:'file',
name:'file',
inputType:'file',
cls:'x-form-item'
},
{
xtype:"combo",
fieldLabel: '模型',
id:'combo',
name: 'combo',
store: new Ext.data.SimpleStore({
fields: ['value', 'text'],
data: [
['value1', 'text1'],
['value2', 'text2']
]
}),
displayField: 'text',
valueField: 'value',
mode: 'local',
emptyText:'请选择',
cls:'x-form-item',
triggerAction: 'all'
}
],
buttons:[
{
text:'添加',
handler:function(){
alert(Ext.getCmp('file').getValue() + ' ' + Ext.getCmp('combo').getValue());
}
},
{
text:'重置',
handler:function(){
Ext.addForm.getForm().reset();
}
}
]
});
Ext.TmpAdminPanel = new Ext.Panel({
renderTo:'content',
width:500,
height:300,
layout:'border',
frame:true,
items:[
Ext.addForm
]
});
});
.x-form-item {
float:left;
margin-bottom:30px;
}
[color=red]模型重置成功!
但模板重置不成功!不知为什么??[/color]