0
   columns:[[  
            {field:'limitid',title:'Limit ID',width:250,sortable:'true',  
                formatter:function(value){  
                    for(var i=0; i<limitidlist.length; i++){
                       if (limitidlist[i].limitid == value) return limitidlist[i].name;
                    }
                    return value;  
                },  
                editor:{  
                    type:'combobox',
                        options:{
                        valueField:'limitid',
                        textField:'name',
                        data:limitidlist,
                        required:true ,
                              $('#outstanding_currency').combobox('setValue', 'LKR');    
                            }
                        } 
                }  
            },  

{field:'outstanding_currency',title:'Outstanding Currency',width:150,  
    formatter:function(value){  
        for(var i=0; i<currencylist.length; i++){
if (currencylist[i].currency == value) return currencylist[i].name;
        }
        return value; 
    },  
    editor:{  
        type:'combobox',
options:{
valueField:'currency',
textField:'name',
data:currencylist,
required:true
} 
    }  
},  

实际上这就是我需要的

当有人选择“limitid”时,我想显示选择的“outstanding_currency”,如“LKR”、“AUS”等,给定的解决方案不适用于此

4

1 回答 1

0

尝试这个,

初始化您的combobox.

$('#combo2').combobox({
     //your stuff
}); 

$('#combo1').combobox({  
   //ur stuff,
   onSelect:function(record){ 
      $('#combo2').combobox('setValue', record.id); //the value id of combo 1 which is equal to the id of combo 2
   }
});  

这是关于组合框方法的文档, http://jeasyui.com/documentation/index.php#

更新

如果是这种情况,您可以onselect编辑器选项中使用

editor:{  
            type:'combobox',
            options:{
                    valueField:'limitid',
                    textField:'name',
                    data:limitidlist,
                    required:true ,
                    onSelect:function(record){ 
                         $('#outstanding_currency').combobox('setValue', record.limitid); 
                        }   
                 }
        } 
于 2012-12-19T08:22:21.447 回答