【发布时间】:2019-09-18 07:09:19
【问题描述】:
一个简单的问题。 我有 2 个控件更改事件。
我有第一个事件:
ctrlProducto_tipo.on ('change', function(e){
if (this.getValue()== 'Up'){
var strProducto = 'U';}
if (this.getValue()== 'Down'){
var strProducto = 'D';}
if (this.getValue()== 'Left'){
var strProducto = 'L';}
if (this.getValue()== 'Right'){
var strProducto = 'R';}
ctrlTest1.setValue(strProducto);
});
当我选择“Down”时,我的text1.textfield“D”中有一个
在我的第二个事件中显示Test2.textbox:
ctrlEspesor.on ('keyup', function(e){
if (this.getValue()!== ''){
var strEspesor = ctrlEspesor.getValue();}
ctrlTest2.setValue(strEspesor);
当我输入“4”时,我有“4”。
这两个事件有效。
但现在我尝试将strProducto 和strEspesor 连接到ctrlTest3.textbox (在ctrlTest1 和ctrlTest2 之前没有显示)。
但每次用户更改两个值之一时,我都需要ctrlText3 即时更新。
我尝试这个,但没有成功。
var valueFinal = strProducto.concat(strEspesor);
ctrlTest3.setValue(valueFinal);
ctrlTest3 的示例:'D4'
欢迎大家帮忙,谢谢.....
【问题讨论】:
标签: javascript events concatenation