小弟初时EXTJS,项目中碰到一个小问题,就是要增加一个下拉框,选中里面的数据后,显示在文本域中,不知道怎么写,写了多次都报EXT-all-dub.js的错误。
附件中有关于这个操作的图片。。。谢谢了。
原代码:
xtype:"window",
title:"任务派遣",
width:500,
modal:true,
height:400,
layout:"fit",
initComponent: function(){
orgWindow = new HM.orgWindow({rootId:this.rootOrg, withUser:false,rootText:this.rootOrgText,singleSelect:true,onSave:function(o){
this.form.getForm().findField("sendOrg").setValue(o.tree.getValue());
this.form.getForm().findField("_sendOrg").setValue(o.tree.getValue("text"));
o.hide();
}.createDelegate(this)
});
orgWindow2 = new HM.orgWindow({rootId:this.rootOrg, withUser:false,rootText:this.rootOrgText,onSave:function(o){
this.form.getForm().findField("assistOrg").setValue(o.tree.getValues());
this.form.getForm().findField("_assistOrg").setValue(o.tree.getValues(null,"text"));
o.hide();
}.createDelegate(this)
});
this.form = new Ext.form.FormPanel({
xtype:"form",
title:"",
labelWidth:80,
labelAlign:"right",
layout:"form",
region:"center",
items:[{
xtype:"hidden",
name:"sendOrg"
},{
xtype:"hidden",
name:"assistOrg"
},{
layout:"column",
anchor:"100%",
items:[{
layout:"form",
columnWidth:.85,
items:[{
xtype:"textfield",
fieldLabel:"主办部门",
allowBlank:false,
name:"_sendOrg",
readOnly :true,
anchor:"95%",
listeners:{
focus:orgWindow.show.createDelegate(orgWindow)
}
}]
},{
columnWidth:.12,
items:[{
xtype:"button",
text:"选择",
//icon:rootPath + '/images/commons/orgempty.png',
handler:function(){orgWindow.show()}
}]
}]
},{
layout:"column",
anchor:"100%",
items:[{
layout:"form",
columnWidth:.85,
items:[{
xtype:"textfield",
fieldLabel:"协办部门",
name:"_assistOrg",
readOnly :true,
anchor:"95%",
listeners:{
focus:orgWindow2.show.createDelegate(orgWindow2)
}
}]
},{
columnWidth:.12,
items:[{
xtype:"button",
text:"选择",
//icon:rootPath + '/images/commons/orgempty.png',
handler:function(){orgWindow2.show()}
}]
}]
},
{
xtype:"textfield",
fieldLabel:"派遣常用语",
name:"habitwords",
anchor:"95%",
height:20
},
{
xtype:"textarea",
fieldLabel:"派遣意见",
maxLength:500,
name:"opinion",
anchor:"95%",
height:200
},
{
xtype:"datefield",
fieldLabel:"完成截止时间",
allowBlank:false,
format : 'Y-m-d H:i',
menu:new DatetimeMenu(),
name:"rollEndTime",
anchor:"95%"
}
]
});
this.items=[
{
xtype:"panel",
title:"",
autoScroll:true,
frame:true,
layout:"border",
items:[
this.form
]
}
];
this.buttons = [{
text:"确定",
handler:function(){
if(this.form.getForm().isValid()){
if(this.form.getForm().findField('rollEndTime').getValue().getTime()<new Date().getTime()){
Ext.Msg.alert("提示", "完成截止时间不能早于当前时间!");
return;
}
this.submit();
}
},
scope:this
},{
text:"关闭",
handler:function(){
this.hide();
},
scope:this
}]
HM.workflow.sendWindow.superclass.initComponent.call(this);
}