[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

adg headerfilter dropdownlist

Posted on 2011-03-10
5
Medium Priority
?
463 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 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

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

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 the below post we have mentioned the best hosting type for startups. Also, check out some of the superlative web hosting companies that are proposing affordable web hosting solutions to host your startup website.
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Screencast - Getting to Know the Pipeline
Suggested Courses
Course of the Month18 days, 16 hours left to enroll

834 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