Index: ssts-web/src/main/webapp/js/common.js =================================================================== diff -u -r15869 -r15971 --- ssts-web/src/main/webapp/js/common.js (.../common.js) (revision 15869) +++ ssts-web/src/main/webapp/js/common.js (.../common.js) (revision 15971) @@ -2381,7 +2381,7 @@ } catch (error) { // 如果Ext2不存在则用Ext4 - extObj = Ext4 || top.Ext4; + extObj = top.Ext4 || Ext4; } return extObj; } @@ -2457,4 +2457,21 @@ ipt.focus(); }catch(e){} },dt); +} + +/** + * 从对应的数据源里根据提供的key来查找,如果找得到,则将找到的值按setValueObj的规则进行设置 + * @param record 选中的记录 + * @param store 要查找的数据源 + * @param setValueObj 要设置的值,可以多个 + */ +function resetComboData(recordConfig, store, setValueObj, extObj) { + var data = store.findRecord(recordConfig.property, recordConfig.val); + var ext = extObj || top.Ext4; + if (!ext.isEmpty(data)){ + //注:(这个方法只支持Ext4Js) + ext.Object.each(setValueObj, function(id, value) { + ext.getCmp(id).setValue(data.get(value)); + }); + } } \ No newline at end of file