?
Solved

adg headerfilter dropdownlist

Posted on 2011-03-10
5
Medium Priority
?
459 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 2000 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 2000 total points
ID: 35173148
Hi arigs,
can you update status of your question and close this ticket.
Thanks,
David
0

Featured Post

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

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…
In this modest contribution, I want to share with the IT community (especially system administrators, IT Support Engineers and IT Help Desks) about Windows crashes/hangs and how to deal with these particular problems.
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses
Course of the Month11 days, 18 hours left to enroll

752 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