Solved

adg headerfilter dropdownlist

Posted on 2011-03-10
5
452 Views
Last Modified: 2012-06-27
Hi experts,

                     I am using flex4 and adg in which at each header of the columns I have a filter image (on clicking  this a popup dropdown list of filter labels will appear in that respective column) . my problem is when we click on the
another filter image the already opened dropdown list is not closing. any help?
0
Comment
Question by:arigs
  • 3
  • 2
5 Comments
 
LVL 20

Expert Comment

by:ChristoferDutz
ID: 35107115
One solution would be to create a filter-manager who's instance is passed to the filter elements. This filter manager "knows" all filter instances and as soon as a filter opens, the filter notifies the filter manager which then takes care of closing all the other filter instances.

Your filter manager needs a public "filterOpened(filterInstance)" function for this and all your filters a function "closeFilter()" this programatically closes a filter.

Another solution would be to use the commercial Flexilicious Datagrid (http://www.flexicious.com/)
0
 
LVL 29

Accepted Solution

by:
dgofman earned 500 total points
ID: 35134552
I will set a focus handler on open event.

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
			   xmlns:s="library://ns.adobe.com/flex/spark" 
			   xmlns:mx="library://ns.adobe.com/flex/mx">
	<s:layout>
		<s:HorizontalLayout/>
	</s:layout>
	<fx:Script>
		<![CDATA[
			private function setFocusListener(event:Event):void{
				event.target.addEventListener(FocusEvent.FOCUS_OUT, onFocusOut);
			}
			
			private function onFocusOut(event:FocusEvent):void{
				event.target.removeEventListener(FocusEvent.FOCUS_OUT, onFocusOut);
				ComboBox(event.target).close();
			}
		]]>
	</fx:Script>
	<mx:ComboBox id="cmb1" open="setFocusListener(event)"/>
	<mx:ComboBox id="cmb2" open="setFocusListener(event)"/>
</s:Application>

Open in new window

0
 
LVL 20

Expert Comment

by:ChristoferDutz
ID: 35136169
But your approach is a lot trickier if you have your comboboxes in the headers of an AdvancedDataGrid. Then you can't automatically register for the "open" event. This has to be done inside the header-renderer.
0
 
LVL 29

Expert Comment

by:dgofman
ID: 35140605
Right you can use my approach anywhere in your code in itemRenderer, headerRenderer or in the form.
0
 
LVL 29

Assisted Solution

by:dgofman
dgofman earned 500 total points
ID: 35173148
Hi arigs,
can you update status of your question and close this ticket.
Thanks,
David
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

First things first - Preparation We need all the part for this install and it's much nicer to have them all on hand when you need them so here's what's required. Download Eclipse 3.5 32 bit (I like the Classic flavour) from here. (http://www.e…
Find out what Office 365 Transport Rules are, how they work and their limitations managing Office 365 signatures.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now