首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > PowerDesigner >

依据输入key值设定Dropdownlist应该显示的name

2012-10-30 
根据输入key值设定Dropdownlist应该显示的name?this.dropDownList1.selectedIndex indexOf(S001,dropDow

根据输入key值设定Dropdownlist应该显示的name

?

this.dropDownList1.selectedIndex = indexOf(S001,dropDownList1,"key");/** * 取得指定下拉列表控件索引ID */private function indexOf(searchId:String,obj:Object,key:String):int{var list:ArrayCollection = obj.dataProvider as ArrayCollection;if (list == null) {return -1;}//循环判断指定下拉表name所对应的下拉表IDfor (var i:int = 0; i < list.length; ++i) {if (list.getItemAt(i)[key]==searchId){return i;}}return -1;}

?

热点排行