日期:2014-05-16 浏览次数:20280 次
function setCombo(id,allInfo)/*id为combobox的id,allInfo参数的格式为 [{value:,text:},......]*/ { var comBo=Ext.getCmp(id); if(!comBo) return false; var store=comBo.getStore(); store.removeAll(); for(var i=0;i<=allInfo.length-1;i++) { var record=new Ext.data.Record({value:allInfo[i].value,text:allInfo[i].text}); store.add(record); } if(allInfo.nowValue) comBo.setValue(allInfo.nowValue); }