Solved

adg headerfilter dropdownlist

Posted on 2011-03-10
5
457 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Flex dropdownlist displays [object][object] 2 1,410
Looping thru 2 dim array 2 607
Flex (as3) add parameters to addEventListener 2 774
Display PHP content using Adobe AIR 9 479
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…
The world seems to conceive of a curious bubble separating IT from “the business.”  More so than just about any other pursuit in the commercial world, people think of IT as some kind of an island.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

730 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