[flexcoders] Re: StyleName property ignored : when precisely and workarround ?
labelplacement is a property not a style, as is alpha. Try reading some documentation before diving into workarrounds http://livedocs.adobe.com/flex/3/langref/mx/controls/ProgressBar.html#propertySummary P.S. if you`re not using setstyle to set it then you should not put it in a css file
[flexcoders] Re: Possible to add a textinput to a TabNavigator (next to the tabs)
If your component is static and will never change , children will never get removed and no new children will be added you could try an absolute positioning. I do not recommend spacer tho. On the other hand you could try to make your own component , you say that you are new to flex so I guess that may be scary and you would not know where to start . Help yourself to this, I'm not saying it's finished but I do think it's the best approach : package { import mx.containers.TabNavigator; import mx.controls.TabBar; import mx.controls.TextInput; import mx.core.FlexVersion; import mx.styles.StyleProxy; public class ExtendedTabNavigator extends TabNavigator { public function ExtendedTabNavigator() { } //we don t realy need this, tabBarHeight could be tabBar.height but eh private function get tabBarHeight():Number { var tabHeight:Number = getStyle(tabHeight); if (isNaN(tabHeight)) tabHeight = tabBar.getExplicitOrMeasuredHeight(); return tabHeight - borderMetrics.top; } protected var textS:TextInput; override protected function createChildren():void { //doesn't matter when we call super, we are not messing with the actual tabbar super.createChildren() //creating out textInput if(!textS) { textS = new TextInput //you can make a style for this so that it's not hard.coaded, easiest way. no need for internals textS.width = 100; //adding our textInput rawChildren.addChild(textS); } } override protected function updateDisplayList(unscaledWidth:Number,unscaledHeight:Number):void { super.updateDisplayList(unscaledWidth, unscaledHeight); //move the textInput so that it appears right of the tabbar var leftOffset:Number = getStyle(tabOffset); //watch out for borderThickness //in case your tabnav has a border soldi with a set borderthickness //we will also remove it from the move of tabbar and texti - coming next var borderThick:Number = getStyle(borderThickness); switch (getStyle(horizontalAlign)) { case left: //addede calcs for -borderthick tabBar.move(0 + borderThick + leftOffset, tabBar.y); textS.move(0 + borderThick + leftOffset + tabBar.width, tabBar.y) break; case right: //because txeti is right of tabbar we have to also move the tabbar , //we could move texti left of the tabbar //and leave the tabbar alone, your choice //also addede calculation for -borderthick tabBar.move(unscaledWidth - tabBar.width - textS.width -borderThick + leftOffset, tabBar.y); textS.move(unscaledWidth - textS.width -borderThick + leftOffset, tabBar.y) break; case center: //no need for borderthick tabBar.move((unscaledWidth - tabBar.width - textS.width) / 2 + leftOffset, tabBar.y); textS.move((unscaledWidth + tabBar.width - textS.width ) / 2 + leftOffset, tabBar.y) } //set textI height textS.height = tabBar.height//tabBarHeight; } } } Feel free to ask if there is something unclear
[flexcoders] Re: Possible to add a textinput to a TabNavigator (next to the tabs)
--- In flexcoders@yahoogroups.com, gmoniey22 gmonie...@... wrote: Thanks for the reply...I come from a Java background, so creating a custom component is not scary so to speak...I was just hoping there may be an easier way to do it directly to the TabNavigator instance. Also, out of curiosity, why do you not recommend the spacer? When I said it would be scary all I was saying was that sometimes it can take a long time to set up exactly as needed. I did not mean to offend you in any way. I don't like the spacer idea mainly because it's a 3'rd party, with it's own width or height, I don't see the need for it, not here anyway. If that (extending component) is not the wanted approach you can always try the absolute positioning. I would recommend something like this ?xml version=1.0? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; mx:Canvas width=100% height=100% mx:TabNavigator id=tabN width=100% height=100% updateComplete=textI.setStyle('left',tabN.getTabAt(tabN.numChildren-1).x+tabN.getTabAt(tabN.numChildren-1).width) mx:VBox /mx:VBox mx:VBox /mx:VBox mx:VBox /mx:VBox /mx:TabNavigator mx:TextInput id=textI / /mx:Canvas /mx:Application So that is textI.setStyle('left',tabN.getTabAt(tabN.numChildren-1).x+tabN.getTabAt(tabN.numChildren-1).width) Setting it on the update complete of the tabnavigator and not on the creationcomplete of the textinput. This way you take into account any resize that might happen the id on the tabNavigator can be removed and tabN inside the setStyle() can be substituted with event.target or event.currentTarget
[flexcoders] Re: Possible to add a textinput to a TabNavigator (next to the tabs)
In case anyone needs a more detailed explanation the need for getTabAt(tabN.numChildren-1). We cannot access tabN.tabBar because of it's protected attribute so we cannot directly get the tabBar's width. That is why we are getting the last-tab's button instance x + witdh , It's the exact width of the tabBar. The x of the (last-tab's button instance) is the sum of all preceding tab button instances + any style the tabnavigator might set. Again, :) not trying to offend anyone, just that not everyone will understand exactly what getTabAt(tabN.numChildren-1) means.
[flexcoders] Re: Possible to add a textinput to a TabNavigator (next to the tabs)
After reading your second post with the .addChild I guess this would be helpful. Here it is ?xml version=1.0? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; creationComplete=addTI() mx:Script ![CDATA[ import mx.controls.TabBar; import mx.containers.VBox; import mx.controls.TextInput; private var ti:TextInput = new TextInput private function addTI():void { tabN.rawChildren.addChild(ti); } private function Upda():void { var tabBar:TabBar = tabN.getTabAt(0).parent as TabBar; var leftOffset:Number = tabN.getStyle(tabOffset); var borderThick:Number = tabN.getStyle(borderThickness); ti.width = 100 ti.height = tabN.getTabAt(0).height switch (tabN.getStyle(horizontalAlign)) { case left: tabBar.move(0 + borderThick + leftOffset, tabBar.y); ti.move(0 + borderThick + leftOffset + tabBar.width, tabBar.y) break; case right: tabBar.move(tabN.width - tabBar.width - ti.width -borderThick + leftOffset, tabBar.y); ti.move(tabN.width - ti.width -borderThick + leftOffset, tabBar.y) break; case center: tabBar.move((tabN.width - tabBar.width - ti.width) / 2 + leftOffset, tabBar.y); ti.move((tabN.width+ tabBar.width - ti.width ) / 2 + leftOffset, tabBar.y) } } ]] /mx:Script mx:TabNavigator id=tabN width=100% height=100% updateComplete=Upda() mx:VBox /mx:VBox mx:VBox /mx:VBox mx:VBox /mx:VBox /mx:TabNavigator mx:HBox mx:Button click=tabN.addChild(new VBox) label=add child/ mx:Button click=tabN.removeChildAt(0) label=remove child/ mx:Button click=tabN.setStyle('horizontalAlign','left') label=left align/ mx:Button click=tabN.setStyle('horizontalAlign','center') label=center align/ mx:Button click=tabN.setStyle('horizontalAlign','right') label=right align/ /mx:HBox /mx:Application quote: Although at the level of a Flash DisplayObjectContainer, all children are equal, in a Flex Container some children are more equal than others. (George Orwell, Animal Farm) In particular, Flex distinguishes between content children and non-content (or chrome) children. Content children are the kind that can be specified in MXML. If you put several controls into a VBox, those are its content children. Non-content children are the other ones that you get automatically, such as a background/border, scrollbars, the titlebar of a Panel, AccordionHeaders, etc. Most application developers are uninterested in non-content children, so Container overrides APIs such as numChildren and getChildAt() to deal only with content children. For example, Container, keeps its own _numChildren counter. Container assumes that content children are contiguous, and that non-content children come before or after the content children. In order words, Container partitions DisplayObjectContainer's index range into three parts: A B C D E F G H I 0 1 2 3 4 5 6 7 8- index for all children 0 1 2 3- index for content children The content partition contains the content children D E F G. The pre-content partition contains the non-content children A B C that always stay before the content children. The post-content partition contains the non-content children H I that always stay after the content children. Container maintains two state variables, _firstChildIndex and _numChildren, which keep track of the partitioning. In this example, _firstChildIndex would be 3 and _numChildren would be 4. quote: A container typically contains child components, which can be enumerated using the
[flexcoders] Re: storing login data from a cfquery for use throught flex app
give this a try , the problem may be the return type, struct for successful and boolean for unsuccessful cffunction name=loginUser access=remote returntype=struct //do your stuff cfset returnValue = structnew() cfset returnValue.success = false cfset returnValue.lastResult = cfif checkAuthentication.recordCount EQ 1 cfset returnValue.success = true cfset returnValue.lastResult = checkAuthentication /cfif cfreturn returnValue/ /cffunction private function login_result(event:ResultEvent):void { if(Number(event.result.success) == 1 || String(event.result.success).toLowerCase() == true) { this.dispatchEvent( new Event('loginSuccessful') ); var store:ArrayCollection = new ArrayCollection(ArrayUtil.toArray(event.result.lastResult)) } else errorMessage(Login unsuccessful); }
[flexcoders] Re: generating codes that users can use to pay for a service
--- In flexcoders@yahoogroups.com, stinasius stinas...@... wrote: hello guys before i ask this let me say i know that many people will probably suggest using online payment systems like paypal but that is not an option in my case. so this is what i would like to know. i have a website where companies can post ads but before they can post the ad they have to have a code(key) which they purchase. lets say someone wanted to have his ad running for a month and the total monthly charge is 20 dollars, they have to purchase the code for 20 dollars which they input into the system and if valid then they can post their ad. can i create a system in flex/as3/coldfusion to generate the codes and tie a particular code to an amount for example if you want your ad to run for a month and it costs $20 then the system generates different codes that are worth $20 or can i use a database of some kind to store the codes? and how can i validate the code is worth $20? hope my question is clear. Google: CreateUUID().
[flexcoders] Re: Grid with header sections spanning the whole grid
Something like this? ?xml version=1.0? !-- dpcontrols/adg/ColumnGroupADG2NestedGroups.mxml -- mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=vertical mx:Script ![CDATA[ import mx.controls.advancedDataGridClasses.AdvancedDataGridColumnGroup; import mx.controls.advancedDataGridClasses.AdvancedDataGridColumn; private function addADG():void { var adg:AdvancedDataGrid = new AdvancedDataGrid; var column1:AdvancedDataGridColumn = new AdvancedDataGridColumn var column2:AdvancedDataGridColumn = new AdvancedDataGridColumn var column3:AdvancedDataGridColumn = new AdvancedDataGridColumn var column4:AdvancedDataGridColumn = new AdvancedDataGridColumn var column5:AdvancedDataGridColumn = new AdvancedDataGridColumn var group1:AdvancedDataGridColumnGroup = new AdvancedDataGridColumnGroup var group2:AdvancedDataGridColumnGroup = new AdvancedDataGridColumnGroup var group3:AdvancedDataGridColumnGroup = new AdvancedDataGridColumnGroup group1.children = [column2,column3] group2.children = [column4,column5] group3.children = [group1,group2] adg.groupedColumns = [column1,group3] this.addChild(adg) } ]] /mx:Script mx:AdvancedDataGrid id=myADG width=100% mx:groupedColumns mx:AdvancedDataGridColumn/ mx:AdvancedDataGridColumnGroup mx:AdvancedDataGridColumnGroup mx:AdvancedDataGridColumn/ mx:AdvancedDataGridColumn/ /mx:AdvancedDataGridColumnGroup mx:AdvancedDataGridColumnGroup mx:AdvancedDataGridColumn/ mx:AdvancedDataGridColumn/ /mx:AdvancedDataGridColumnGroup /mx:AdvancedDataGridColumnGroup /mx:groupedColumns /mx:AdvancedDataGrid mx:Button label=add with as click=addADG()/ /mx:Application also, if you haven't, check out lockedColumnCount and sortExpertMode
[flexcoders] Re: Feedback and ideas re: publishing a collection of poems
Wow, first If a different computer on the web could use a different font you don t have to worry about that, font s are embeded into the app, not accessed on the user side. mx:TextArea text={'this'+ '\n' +'is'+ '\n' +'a'+ '\n' +'test'} width=100% height=100/ \n = new line OR mx:TextArea width=100% height=100% selectable=false editable=false mx:htmlText ![CDATA[ thisbr/isbr/abr/testbr/thisbr/textbr/areabr/hasbr/abr/scrollbr/barbr/alsobr/itbr/is br/notbr/selectablebr/orbr/editablebr/ thisbr/isbr/abr/testbr/thisbr/textbr/areabr/hasbr/abr/scrollbr/barbr/alsobr/itbr/is br/notbr/selectablebr/orbr/editablebr/ thisbr/isbr/abr/testbr/thisbr/textbr/areabr/hasbr/abr/scrollbr/barbr/alsobr/itbr/is br/notbr/selectablebr/orbr/editablebr/ thisbr/isbr/abr/testbr/thisbr/textbr/areabr/hasbr/abr/scrollbr/barbr/alsobr/itbr/is br/notbr/selectablebr/orbr/editablebr/ thisbr/isbr/abr/testbr/thisbr/textbr/areabr/hasbr/abr/scrollbr/barbr/alsobr/itbr/is br/notbr/selectablebr/orbr/editablebr/ ]] /mx:htmlText /mx:TextArea br/ = break text scrolling automatically, but with controls added for the person reading the poem - like what ? play scroll pause scroll stop scroll ?
[flexcoders] Re: Detaching RichTextArea controls
well, the rte is actually a panel +textarea + controlbar + toolbar when clicking one of the buttons a function get's called PRIVATE function setTextStyles(type:String, value:Object = null):void this function check's if there is a current selection on the textarea if not set's the style if there is it set's the style only for the selection var tf:TextFormat; var beginIndex:int = textArea.getTextField().selectionBeginIndex; var endIndex:int = textArea.getTextField().selectionEndIndex; if (beginIndex == endIndex) { tf = previousTextFormat; } else tf = new TextFormat(); etc textArea.getTextField().setTextFormat(tf,beginIndex,endIndex); textArea.invalidateDisplayList(); textArea.validateDisplayList(); so, extending this one would be a pain. I vote for make your own from scratch just get the control bar and for the click events make your own function that changes the textarea that has focus I'm not saying this is the best approach(it's just what I would do).
[flexcoders] Re: Accordion question - height minus header space
child's height or width can be specified percent wise width=100% myComponent.percentWidth = 100; but if you have to you have to http://livedocs.adobe.com/flex/3/langref/mx/containers/Accordion.html quote : headerHeight=depends on header font styles = Number(myAccordion.getStyle('headerHeight'))
[flexcoders] Re: Set DataGrid selected items
?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=vertical mx:Script ![CDATA[ import mx.collections.ArrayCollection; import mx.controls.Alert; private function selectNow(event:MouseEvent):void { if(event.target.name == one) { aqe.selectedCells = [{ rowIndex : 1, columnIndex : 1}] } else { aqe.selectedCells = [ { rowIndex : 1, columnIndex : 1},{ rowIndex : 3, columnIndex : 3 }] } } private function selectNow2(event:MouseEvent):void { if(event.target.name == one) { aqe2.selectedItem = datap.getItemAt(0) } else { aqe2.selectedItems = [datap.getItemAt(0),datap.getItemAt(3)] } } private function selectNow3(event:MouseEvent):void { if(event.target.name == one) { aqe3.selectedIndex = 2 } else { aqe3.selectedIndices = [1,3] } } ]] /mx:Script mx:ArrayCollection id=datap mx:Object a=test b=ing c=this d=component/ mx:Object a=test b=ing c=this d=component/ mx:Object a=test b=ing c=this d=component/ mx:Object a=test b=ing c=this d=component/ /mx:ArrayCollection mx:AdvancedDataGrid id=aqe selectionMode=multipleCells dataProvider={datap} mx:columns mx:AdvancedDataGridColumn dataField=a/ mx:AdvancedDataGridColumn dataField=b/ mx:AdvancedDataGridColumn dataField=c/ mx:AdvancedDataGridColumn dataField=d/ /mx:columns /mx:AdvancedDataGrid mx:Button name=one label=select one cell above click=selectNow(event)/ mx:Button label=select two cells above click=selectNow(event)/ mx:AdvancedDataGrid id=aqe2 selectionMode=multipleRows dataProvider={datap} mx:columns mx:AdvancedDataGridColumn dataField=a/ mx:AdvancedDataGridColumn dataField=b/ mx:AdvancedDataGridColumn dataField=c/ mx:AdvancedDataGridColumn dataField=d/ /mx:columns /mx:AdvancedDataGrid mx:Button name=one label=select one row above by item click=selectNow2(event)/ mx:Button label=select two rows above by items click=selectNow2(event)/ mx:AdvancedDataGrid id=aqe3 selectionMode=multipleRows dataProvider={datap} mx:columns mx:AdvancedDataGridColumn dataField=a/ mx:AdvancedDataGridColumn dataField=b/ mx:AdvancedDataGridColumn dataField=c/ mx:AdvancedDataGridColumn dataField=d/ /mx:columns /mx:AdvancedDataGrid mx:Button name=one label=select one row above by index click=selectNow3(event)/ mx:Button label=select two rows above by indices click=selectNow3(event)/ /mx:Application Hope this helps.
[flexcoders] Re: Relative Layout Question
This should do the trick ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; verticalGap=0 paddingTop=0 paddingBottom=0 width=600 height=600 mx:Panel height=75% mx:Text text=This panel should take up 75% of the application's height / /mx:Panel mx:Panel id=my25panel height=25% layout=absolute title={100/(this.height/my25panel.height)} mx:Accordion mx:Form mx:Text text=Item 1 / mx:Text text=Item 2 / mx:Text text=Item 3 / mx:Text text=Item 4 / /mx:Form mx:Form mx:Text text=Item 1 / mx:Text text=Item 2 / mx:Text text=Item 3 / mx:Text text=Item 4 / /mx:Form mx:Form mx:Text text=Item 1 / mx:Text text=Item 2 / mx:Text text=Item 3 / mx:Text text=Item 4 / /mx:Form mx:Form mx:Text text=etc / /mx:Form /mx:Accordion /mx:Panel /mx:Application Or you could always try something like this ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=vertical verticalGap=0 paddingTop=0 paddingBottom=0 height=600 mx:Script ![CDATA[ import mx.events.FlexEvent; private function setHeight(e:FlexEvent,number:Number):void { e.target.height = (this.height*number) } ]] /mx:Script mx:Panel creationComplete=setHeight(event,0.75) width=100% mx:Text text=This panel should take up 75% of the application's height / /mx:Panel mx:Panel id=mlo width=100% title={100/(this.height/mlo.height)} creationComplete=setHeight(event,0.25) mx:Accordion mx:Form mx:Text text=Item 1 / mx:Text text=Item 2 / mx:Text text=Item 3 / mx:Text text=Item 4 / /mx:Form mx:Form mx:Text text=Item 1 / mx:Text text=Item 2 / mx:Text text=Item 3 / mx:Text text=Item 4 / /mx:Form mx:Form mx:Text text=Item 1 / mx:Text text=Item 2 / mx:Text text=Item 3 / mx:Text text=Item 4 / /mx:Form mx:Form mx:Text text=Item 1 / mx:Text text=Item 2 / mx:Text text=Item 3 / mx:Text text=Item 4 / /mx:Form mx:Form mx:Text text=etc / /mx:Form /mx:Accordion /mx:Panel /mx:Application --- In flexcoders@yahoogroups.com, Tracy Spratt tspr...@... wrote: Well, first, you are specifying that the two panels take up a total of 100% of the app height, so what you describe is what you are asking for. You can use an expression in binding braces. Try this, see if it does what you want: mx:Panel height={this.height/4} Tracy Spratt Lariat Services Flex development bandwidth available From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Keith Hughitt Sent: Friday, February 20, 2009 11:37 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Relative Layout Question Hi all, I have a question about using creative relatively-sized layouts: The default behavior http://livedocs.adobe.com/flex/3/langref/mx/containers/Panel.html of many containers is to use adopt a height just large enough to fit all of it's children content. Manually specifying a relative height (e.g. 25%) for the container will work, but only if the content is small enough. Otherwise the height is increased to fit the content. e.g. ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=vertical width=600 height=600 mx:Panel height=75% mx:Text text=This panel should take up 75% of the application's height / /mx:Panel mx:Panel height=25% mx:Accordion mx:Form mx:Text text=Item 1 / mx:Text text=Item 2 / mx:Text text=Item 3 / mx:Text text=Item 4 / /mx:Form mx:Form mx:Text text=etc / /mx:Form /mx:Accordion /mx:Panel /mx:Application Instead of taking up 25% of the application height the bottom panel will expand to fit the accordion (which in turn has a height equal to the amount of space used up by it's larged child). Is there anyway I can force the panel to only expand to 25% of the main
[flexcoders] Re: PHP data capture issue
remote object? result=myfunction(event) private function myfunction(resulte:resultEvent):void { yourArrc = new arrayCollection(ArrayUtil.toArray(resulte.result)) or mydg.dataprovider = resulte.result (and no variable on dataprovider) } dg id=mydg dataprovider={yourArrc} / --- In flexcoders@yahoogroups.com, adeelafsar adeelaf...@... wrote: i have a data grid in my application and am pulling data from a MYSQL DB using php. is there a way to store all that data into an array and pass it to a function or is it possible to just store the data directly coming from php into an array
[flexcoders] Re: Relative Layout Question
Here you go, i think this is it :) if so, always pay attention to the absolute and vertical layout of the components ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; verticalGap=0 paddingTop=0 paddingBottom=0 width=600 height=600 mx:Panel height=70% mx:Text text=This panel should take up 75% of the application's height / /mx:Panel mx:Panel id=my25panel height=30% layout=absolute title={100/(this.height/my25panel.height)} width=100% verticalScrollPolicy=off horizontalScrollPolicy=off mx:Accordion height=100% width=100% mx:Canvas verticalScrollPolicy=on height=100% width=100% mx:VBox verticalScrollPolicy=off height=100% width=100% mx:TextInput/ mx:TextInput/ mx:TextInput/ mx:TextInput/ mx:TextInput/ mx:TextInput/ mx:TextInput/ mx:TextInput/ mx:TextInput/ mx:TextInput/ mx:TextInput/ mx:TextInput/ mx:TextInput/ mx:TextInput/ mx:TextInput/ /mx:VBox /mx:Canvas mx:Canvas verticalScrollPolicy=on height=100% width=100% mx:VBox verticalScrollPolicy=off height=100% width=100% mx:TextInput/ mx:TextInput/ mx:TextInput/ mx:TextInput/ mx:TextInput/ mx:TextInput/ mx:TextInput/ mx:TextInput/ mx:TextInput/ mx:TextInput/ mx:TextInput/ mx:TextInput/ mx:TextInput/ mx:TextInput/ mx:TextInput/ /mx:VBox /mx:Canvas mx:Canvas verticalScrollPolicy=on height=100% width=100% mx:VBox verticalScrollPolicy=off height=100% width=100% mx:TextInput/ mx:TextInput/ mx:TextInput/ mx:TextInput/ mx:TextInput/ mx:TextInput/ mx:TextInput/ mx:TextInput/ mx:TextInput/ mx:TextInput/ mx:TextInput/ mx:TextInput/ mx:TextInput/ mx:TextInput/ mx:TextInput/ /mx:VBox /mx:Canvas /mx:Accordion /mx:Panel /mx:Application
[flexcoders] Re: AdvancedDataGridColumnGroup dynamically speaking
private function test():void { var arr:ArrayCollection = new ArrayCollection(ArrayUtil.toArray(adg.columns)) var dgcolreference:AdvancedDataGridColumn = arr.getItemAt(0) as AdvancedDataGridColumn if(dgcolreference.visible == false) { dgcolreference.visible = true } else { dgcolreference.visible = false } } in this case you would need the column index. It depends on how you re going to call this code . Is it an itemRenderer or headeritemrenderer gridClick, columnClick separate button in the app ?
[flexcoders] Re: Multiple filters on datagrid
From what I understand, is this what you're looking for? (a quick example for you get the basic idea. There are better and cleaner ways to do this.) ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=vertical mx:Script ![CDATA[ import mx.collections.ICollectionView; private function filterScChange(event:Event):void { ICollectionView(grid.dataProvider).filterFunction = filter; ICollectionView(grid.dataProvider).refresh(); } public function filter(item:Object):Boolean { if (item.test1.toUpperCase().match(f1.selectedLabel.toUpperCase()) || item.test2.toUpperCase().match(f2.selectedLabel.toUpperCase()) || item.test3.toUpperCase().match(f3.selectedLabel.toUpperCase()) || item.test4.toUpperCase().match(f4.selectedLabel.toUpperCase())) return true; return false; } ]] /mx:Script mx:ComboBox id=f1 labelField=test1 dataProvider={datap1} change=filterScChange(event)/ mx:ComboBox id=f2 labelField=test2 dataProvider={datap1} change=filterScChange(event)/ mx:ComboBox id=f3 labelField=test3 dataProvider={datap1} change=filterScChange(event)/ mx:ComboBox id=f4 labelField=test4 dataProvider={datap1} change=filterScChange(event)/ mx:ArrayCollection id=datap mx:Object test1=some test2=random test3=text test4=here/ mx:Object test1=also test2=here test3=and test4=here/ mx:Object test1=here test2=and test3=here test4=also/ mx:Object test1=here test2=some test3=random test4=text/ /mx:ArrayCollection mx:ArrayCollection id=datap1 mx:Object test1=some test2=random test3=text test4=here/ mx:Object test1=also test2=here test3=and test4=here/ mx:Object test1=here test2=and test3=here test4=also/ mx:Object test1=here test2=some test3=random test4=text/ /mx:ArrayCollection mx:DataGrid id=grid dataProvider={datap} mx:columns mx:DataGridColumn headerText=UserId dataField=test1/ mx:DataGridColumn headerText=UserName dataField=test2/ mx:DataGridColumn headerText=Active dataField=test3/ mx:DataGridColumn headerText=Last seen dataField=test4/ /mx:columns /mx:DataGrid /mx:Application
[flexcoders] Re: Relative Layout Question
Hm you also said something about a resize I completely blanked on that. Are you doing a manual resize of the component? (mouse involved?)