Solved

adg headerfilter dropdownlist

Posted on 2011-03-10
5
453 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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
LinkList not supported? 8 294
Remember last page selection - swf file 3 291
Why does my Sprite always have a width and height of ZERO? 2 963
Looping thru 2 dim array 2 589
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…
Facing problems with you memory card? Cannot access your memory card? All stored data, images, videos are lost? If these are your questions...than this small article might help you out in retrieving your lost or inaccessible data.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

912 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

21 Experts available now in Live!

Get 1:1 Help Now