flex的下拉框过滤(arraycollection)

	//定义要过滤的字符
			public var filtStr:String;
			 private function toggleFilter(event:Event):void {
 			if (event.currentTarget.text!="") {
 				filtStr=event.currentTarget.text;
 				ac.filterFunction = processFilter;
 			} else {
 				ac.filterFunction = null;
 			}
 				ac.refresh();
 			}

 			private function processFilter(item:Object):Boolean {
 				//regex   parseFloat(item.name) == 0;
			 return ((String)(item.data)).indexOf(filtStr)==0;
 			}
            //查询 用json封装查询条件 			
			private function remotingQuery():void{
				var jsonObject:Object=new Object();
				jsonObject.name="hangzhou";
				jsonObject.value="杭州";
				jsonObject.fromTime="2008-10-10";
				jsonObject.toTime="2008-11-11";
				var dataString = JSON.encode(jsonObject);  
			}

你可能感兴趣的:(json,Flex)