DIRECT 新技术 Extjs扩展实现资本币制下拉存取值 Ext.ux.BaseDataComboBox

   /* currCode : new Ext.form.TextField({
fieldLabel:'资本币制<font color="red">*</font>',
width:100,
name:'currCode',
readOnly : true,
cls:'x-form-field-readonly',
anchor:'100%'
}),*/
//真正存入数据库的的currcode字段设置为隐藏字段
currCodeAlias : new Ext.ux.BaseDataComboBox({
fieldLabel : "资本币制<font color=red>*</font>",
name : "currCodeAlias",
storeParams:{className:'TCurrCode',author:'',orderBy:' order by {currCode}'},
fields : ['currCode','currName'],
title : "(<font color=black>币制代码</font>)<font color=blue>币制名称</font>",
tpl:'<tpl for="."><div class="x-combo-list-item">({currCode})<font color=blue>{currName}</font></div></tpl>',
disabled : this.readOnly,
allowBlank : false,
upperText : true,
editable : false,
emptyText : '请选择',
selectOnFocus:true,
//valueField:'currName',
directFn: BaseCodeDirectAction.getJsonArrayResultPagesByValues,
listeners : {
change : function(field, newValue, oldValue) {
this.editStatus = "系统正在校验<" + field.fieldLabel + ">,请稍后尝试保存!";
BaseCodeDirectAction.getJsonObjectForBaseData('TCurrCode','currCode',newValue, function(result, e){
this.editStatus = null;
if (!Ext.isEmpty(result)) {
if (result.success) {
field.setValue("");
if (!Ext.isEmpty(result.data) && result.data.length>0) {
var c = '('+result.data[0].currCode+')'+result.data[0].currName;
field.setValue(c);
}
}
}
}.createDelegate(this));
}.createDelegate(this)
}
}),

{xtype:'hidden',name:'currCode'},

// 修改 值 对象文件 添加别名字段 currCodeAlias
private String currCodeAlias ;
//有XML配置需要的 修改对应的XML 添加属性 currCodeAlias 其值由SQL获取 根据的是
currCode的值 如下所示:
<property name="currCodeAlias"
formula="(select '(' || cc.CURR_CODE || ')' || cc.CURR_NAME from EPLATFORM.T_CURR_CODE cc where cc.CURR_CODE = CURR_CODE )"
type="string">
</property>
//保存的时候

onSave : function(){
//企业信息 资本币制
var currCodeAlias = this.mainForm.getForm().findField("currCodeAlias").getValue();
var currCode = currCodeAlias.substring(1,4);
this.mainForm.getForm().findField('currCode').setValue(currCode);
}

//后台代码--- 通过资本币制序号 查找 设显示名给资本币制别人 以显示到列表框
if(list.size()>0){
for(ModifyContent modifyContent :list){
if(modifyContent.getModifyOject().equals("EnterpriseInfo")){
String setName="set"+modifyContent.getItemCode().substring(0, 1).toUpperCase()+modifyContent.getItemCode().substring(1);
doMethod( setName,enterpriseInfo,modifyContent);
}else if(modifyContent.getModifyOject().equals("ManagInfo")){
if(modifyContent.getManagerType().equals("A")){
String setMethodName="set"+modifyContent.getItemCode().substring(0, 1).toUpperCase()+modifyContent.getItemCode().substring(1);
doMethod( setMethodName,managInfo1,modifyContent);
}else if(modifyContent.getManagerType().equals("B")){
String setMethodName="set"+modifyContent.getItemCode().substring(0, 1).toUpperCase()+modifyContent.getItemCode().substring(1);
doMethod( setMethodName,managInfo2,modifyContent);
}else if(modifyContent.getManagerType().equals("C")){
String setMethodName="set"+modifyContent.getItemCode().substring(0, 1).toUpperCase()+modifyContent.getItemCode().substring(1);
doMethod( setMethodName,managInfo3,modifyContent);
}
}
}
if(null!= enterpriseInfo.getCurrCode()){
TCurrCode ccode = (TCurrCode) this.getObject(TCurrCode.class, enterpriseInfo.getCurrCode());
enterpriseInfo.setCurrCodeAlias("("+ccode.getCurrCode()+")"+ccode.getCurrName());
}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值