[flexcoders] Re: AdvancedDataGrid Performance Issue
I found one thing after doing some experiment with my application. Slow performance is not happen due to column number exceed. It happens after initializing dataprovide of ADG. Renderer will create performance problem with ADG. Renderer handling some graphic (background Font) operation depend on cell value. So is there any way to minimize this problem? --- In flexcoders@yahoogroups.com, steveroger_flex steveroger_flex@... wrote: Hello Friends, I am using AdvancedDataGrid to represent statistical data. I am creating AdvancedDataGrid column at runtine. Also assigning renderer at runtime. (Using this Reference http://tech.groups.yahoo.com/group/flexcoders/message/161737 ) Actually performance issue occurs when number of columns are exceed to 20. Its really too slow. Actually application is hang at that point. I have to close the application. How to improve ADG performance to handle this situation? Thank you, Steve Roger.
[flexcoders] Re: AdvancedDataGrid Performance Issue
now, I have remove all renderer code of ADG. ADG is displaying data without any formating. But Still its too too slow. Application struck at that point. any idea about this? Steve --- In flexcoders@yahoogroups.com, steveroger_flex steveroger_flex@... wrote: I found one thing after doing some experiment with my application. Slow performance is not happen due to column number exceed. It happens after initializing dataprovide of ADG. Renderer will create performance problem with ADG. Renderer handling some graphic (background Font) operation depend on cell value. So is there any way to minimize this problem? --- In flexcoders@yahoogroups.com, steveroger_flex steveroger_flex@ wrote: Hello Friends, I am using AdvancedDataGrid to represent statistical data. I am creating AdvancedDataGrid column at runtine. Also assigning renderer at runtime. (Using this Reference http://tech.groups.yahoo.com/group/flexcoders/message/161737 ) Actually performance issue occurs when number of columns are exceed to 20. Its really too slow. Actually application is hang at that point. I have to close the application. How to improve ADG performance to handle this situation? Thank you, Steve Roger.
Re: [flexcoders] Re: AdvancedDataGrid Performance Issue
Use the profiler to see what is going on. On 8/9/11 6:57 AM, steveroger_flex steveroger_f...@yahoo.com wrote: now, I have remove all renderer code of ADG. ADG is displaying data without any formating. But Still its too too slow. Application struck at that point. any idea about this? Steve --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , steveroger_flex steveroger_flex@... wrote: I found one thing after doing some experiment with my application. Slow performance is not happen due to column number exceed. It happens after initializing dataprovide of ADG. Renderer will create performance problem with ADG. Renderer handling some graphic (background Font) operation depend on cell value. So is there any way to minimize this problem? --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , steveroger_flex steveroger_flex@ wrote: Hello Friends, I am using AdvancedDataGrid to represent statistical data. I am creating AdvancedDataGrid column at runtine. Also assigning renderer at runtime. (Using this Reference http://tech.groups.yahoo.com/group/flexcoders/message/161737 ) Actually performance issue occurs when number of columns are exceed to 20. Its really too slow. Actually application is hang at that point. I have to close the application. How to improve ADG performance to handle this situation? Thank you, Steve Roger. -- Alex Harui Flex SDK Team Adobe System, Inc. http://blogs.adobe.com/aharui
Re: [flexcoders] Re: AdvancedDataGrid Performance Issue
You mean that using a adg with 20 columns degrade the performance? My question How many adg are u using? What's the no of rows for each adg? Have u used paging? Sent from my iPhone On Aug 9, 2011, at 10:33 PM, Alex Harui aha...@adobe.com wrote: Use the profiler to see what is going on. On 8/9/11 6:57 AM, steveroger_flex steveroger_f...@yahoo.com wrote: now, I have remove all renderer code of ADG. ADG is displaying data without any formating. But Still its too too slow. Application struck at that point. any idea about this? Steve --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , steveroger_flex steveroger_flex@... wrote: I found one thing after doing some experiment with my application. Slow performance is not happen due to column number exceed. It happens after initializing dataprovide of ADG. Renderer will create performance problem with ADG. Renderer handling some graphic (background Font) operation depend on cell value. So is there any way to minimize this problem? --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , steveroger_flex steveroger_flex@ wrote: Hello Friends, I am using AdvancedDataGrid to represent statistical data. I am creating AdvancedDataGrid column at runtine. Also assigning renderer at runtime. (Using this Reference http://tech.groups.yahoo.com/group/flexcoders/message/161737 ) Actually performance issue occurs when number of columns are exceed to 20. Its really too slow. Actually application is hang at that point. I have to close the application. How to improve ADG performance to handle this situation? Thank you, Steve Roger. -- Alex Harui Flex SDK Team Adobe System, Inc. http://blogs.adobe.com/aharui
[flexcoders] Re: AdvancedDataGrid group filtering openNode
I see this has been dormant for a while, but Im having exactly the same problem, and having spent all day on a google trip to nowhere, I figured I'd post here and see if any of the big brains have some ideas... To recap whats below: updating the data provider for a AdvancedDataGrid causes all open groups to collapse. Like the others, Ive tried caching off the previous state and then updating manually to no avail. Any thoughts? --- In flexcoders@yahoogroups.com, Adrian Williams adri...@... wrote: Hi folks, We actually have the same need and including the things y'all have already tried, we even tried to cycle thru the open nodes and write their object to an array, then refreshed then tried to do an open nodes for each in the array without success Alex, et al...any input to this one because it seems like a lot of folks need it! Best, Adrian Angela wrote: I am having the same problem and can't find a solution. Has anyone solved this? Angela --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com, Eric Jones gigado@ wrote: Adnan or Nigel, Did either of you resolve this? Any change you could post a solution? jonese --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com, nigelrmtaylor ntaylor@ wrote: Adnan Did you get any further with this? It looks like I'm trying to solve the same problem as you. Cheers Nigel --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com, Adnan Doric astronaute@ wrote: Hello guys, I'm trying to filter my ADG without success : I created a GroupingCollection from a flat ArrayCollection. ADG's dataProvider is GroupingCollection. First issue : refresh if I filter the underlaying ArrayCollection, the related groupingCollection doesn't refresh automatically (bug? feature?) Actually I menaged to force gc.refresh() with some event( it is impossible to listen on CollectionEventKind.REFRESH because of infinite loop ac.refresh = gc.refresh ) Second issue (more important) : openNodes Ok now that my gc is refreshed, the Tree in the ADG collapses itself (ok let say that is normal), and I need it to expand all nodes that were opened before. I tried to do something like this : var openNodes : Object = IHierarchicalCollectionView( myADG.dataProvider ).openNodes; gc.refresh(); myADG.dataProvider.openNodes = openNodes; and it doesn't works. next I tried this : var openNodes : Object = IHierarchicalCollectionView( myADG.dataProvider ).openNodes; for each( var node : Object in openNodes ) { IHierarchicalCollectionView( myADG.dataProvider.openNode( node ) } guess what, doesn't work :) I'm calling myADG.invalidateList() each time too. I don't know what to do to achieve this simple task, I'm a bit disappointed because I expected lot more from the brand new AdvancedDataGrid and this basic functionality actually seems too hard to implement. I still hope I'm wrong and someone can show me the correct solution :) Thank you all, Adnan
[flexcoders] Re: AdvancedDataGrid custom drawRowBackground with HierarchicalCollectionView
http://flexpearls.blogspot.com/2008/02/row-background-color-in.html I'll give a try but there is no alpha in the solution above. --- In flexcoders@yahoogroups.com, valdhor valdhorli...@... wrote: Have you tried using an item renderer?
[flexcoders] Re: AdvancedDataGrid read cells
I would recommend NOT doing that. You should be looking at the dataprovider for the ADG. --- In flexcoders@yahoogroups.com, Jairo França (TGI) ja...@... wrote: In my application there is an AdvancedDataGrid where I insert rows and columns dynamically. My question seems simple but is driving me crazy: I need to read each cell of my AdvancedDataGrid (scan the AdvancedDataGrid). Remember that the structure is dynamic and I don't know in advance how many columns and rows that I have. Jairo França mailto:ja...@... ja...@... Tecnologia e Gestão da Informação Av. do Contorno, nº 6.777 sl 814 Funcionários - 30.110-043 Belo Horizonte MG Tel: (31) 3297-1144 Cel: (31) 8851-6413
[flexcoders] Re: AdvancedDataGrid column sort arrow
Ignore this post - I had a mistake in my code which I found O_o --- In flexcoders@yahoogroups.com, s_grollins s.groll...@... wrote: Hi all, I need some help with a problem I'm having: Is there a way that anyone knows of to manually change the sort arrow? It seems that no matter what I do the arrow is always reversed from what the sort order is (if the sort is descending the arrow is ascending). And if there is no direct way, like accessing a property or method, is there any round-about way like dispatching a header release event - albeit I'd need to do this without refreshing the data in the grid though. Any help greatly appreciated.
[flexcoders] Re: AdvancedDataGrid Grouping with XML
--- In flexcoders@yahoogroups.com, srieger_1 srie...@... wrote: OK, I have made some progress on this issue but still unable to resolve it completely. It's getting embarrassing already. . . . I am trying to use some XML that I get from an application to feed an advanceddatagrid where I can group the entries. I have a demo with view source here : http://estar.lmsnet.com/lmsdev/testgrouping.html I am trying to group the entries by Category then display the path and file name when the category is expanded. I cannot believe I can't figure this out. I am hoping there are some XML folks out there that can offer some advice . I think you'll need to use a groupingFunction to group on .attribute('name').child('text').text()=='Category' (Sorry, for some reason my blog doesn't email me these days when I get a comment.) HTH; Amy
[flexcoders] Re: advanceddatagrid
Yes. The following example shows one way... main.mxml: ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute mx:Script ![CDATA[ [Bindable] private var dp:Array = [ { symbol: ADBE, name: Adobe Systems Inc., price: 49.95 }, { symbol: BETA, name: Beta Inc., price: 19.95 }, { symbol: CSCO, name: Cisco Inc., price: 45.95 }, { symbol: DELL, name: Dell Inc., price: 34.95 }, { symbol: EXPD, name: Expedia Inc., price: 39.95 }, { symbol: FOXS, name: Fox Sports Inc., price: 9.95 }, { symbol: GOOG, name: Google Inc., price: 139.95 }, { symbol: ICON, name: Icon Inc., price: 32.95 }, { symbol: JUNI, name: Juniper Inc., price: 23.95 }, { symbol: KLA, name: KLA Tencor Inc., price: 37.95 }, { symbol: MACR, name: Macromedia Inc., price: 39.95 }, { symbol: MSFT, name: Microsoft Corp., price: 25.95 }, { symbol: IBM, name: IBM Corp., price: 42.55 } ]; ]] /mx:Script mx:AdvancedDataGrid id=ADG dataProvider={dp} rowCount={dp.length + 1} mx:columns mx:AdvancedDataGridColumn headerText=Name dataField=name/ mx:AdvancedDataGridColumn headerText=Symbol dataField=symbol headerRenderer=SymbolColumnHeaderRenderer/ mx:AdvancedDataGridColumn headerText=Price dataField=price/ /mx:columns /mx:AdvancedDataGrid /mx:Application SymbolColumnHeaderRenderer.as: package { import mx.controls.advancedDataGridClasses.AdvancedDataGridHeaderRenderer; public class SymbolColumnHeaderRenderer extends AdvancedDataGridHeaderRenderer { private const headerBackgroundColor:int = 0x00FF00; override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void { super.updateDisplayList(unscaledWidth, unscaledHeight); graphics.moveTo(0, unscaledHeight); graphics.lineStyle(2, headerBackgroundColor); graphics.lineTo(unscaledWidth, unscaledHeight); graphics.beginFill(headerBackgroundColor); graphics.drawRect(0, -1, unscaledWidth, unscaledHeight + 1); graphics.endFill(); } } } HTH Steve --- In flexcoders@yahoogroups.com, Joe j...@... wrote: is it possible to header color on a column in an advanceddatagrid? I can change all of the headers but not individually. I have tried headerColors in css and styleFunction. I came across a custom skining but it only works for datagrid not advanceddatagrid. Thanks
[flexcoders] Re: AdvancedDataGrid itemOpen() to resize Container
I figured out one way to do it: private function openRow():void{ var windowShade:WindowShade = this as WindowShade; windowShade.height += appColl.source.length * 20; } The problem seemed to be that I was referencing the parent container incorrectly. The thing I want to do now on the itemOpen() event of the AdvancedDataGrid is to get the height of its renderProvider (another AdvancedDataGrid) and then add that to the overall height. I've perused the properties available from the AdvancedDataGridEvent but all I get is access to the current item and an array of renderProviders, not the height of the renderProvider itself. Is there a way to get access to the height of an AdvancedDataGrid's renderProvider? Thank you.
[flexcoders] Re: AdvancedDataGrid virtual/pivot column creation?
Aha can I use the OLAPDataGrid for this? I had thought that its dataprovider had to be in a cubespeak format, but I think I am reading that I can take my SQLServer2005 stored procedure XML result set and massage it into cubespeak with mx:OLAPDimension/ etc. Is this correct? --- In flexcoders@yahoogroups.com, chigwell23 chigwel...@... wrote: Not sure whether virtual or pivot is the right word, but the columns do not exist as columns in the returned result set, but as data. MGR PROD SOLD mgr1 beer 100.99 mgr1 rice 200.55 mgr1 soap 400.33 mgr2 beer 123.50 mgr2 rice 428.88 mgr2 soap 555.55 I wish to turn this into MGR BEER RICE SOAP mgr1 100.99 200.55 400.33 etc. I have the adg doing hierarchical trees, groupings and summaries etc but cannot work out how to do what I think might be a pivot? Have learned a lot with a google on flex adg pivot and flex adg dynamic column but have not found the above yet. TIA, Mic.
[flexcoders] Re: AdvancedDataGrid: expandItem()
I believe the answer is to use callLater before acting on the AdvancedDataGrid. However, the kink is that my dataProvider isn't set until XML is loaded. Here is the setter for the dataProvider (source of my GroupingCollection): public function set applications( arr:Array ):void{ _applications = arr; appColl.source = applications; callLater( expandRow ); } ..And then here is the expandRow() method: private function expandRow():void{ // Expand the first row of the ADG var obj:Object = gc.getRoot(); var temp:Object = ListCollectionView(obj).getItemAt(0); grid.expandItem(temp,true); } mx:dataProvider mx:GroupingCollection id=gc source={appColl} mx:Grouping mx:GroupingField name=label/ /mx:Grouping /mx:GroupingCollection /mx:dataProvider The error I get when I run this code is this: Index '0' specified is out of bounds. I'm just not sure why this might be happening. I mean, I'm using callLater..Any ideas? --- In flexcoders@yahoogroups.com, fumeng5 fume...@... wrote: Hi, I'm trying to expand the first row of my AdvancedDataGrid column when it is loaded with my XML data. I've found plenty of examples online that show how to do it from a click event, but nothing on init of the grid. I've tried the initialize method, the setter of my dataProvider method but they all give me a range out of bounds error. Here's my function: private function expandRow():void{ // Expand the first row of the ADG var obj:Object = gc.getRoot(); var temp:Object = ListCollectionView(obj).getItemAt(0); grid.expandItem(temp,true); grid.validateNow(); } Anyone know the proper event to trigger this? Thank you, Matt
[flexcoders] Re: AdvancedDataGrid/GroupingCollection performance with non-trivial data sets.
--- In flexcoders@yahoogroups.com, dolinja jmdolin...@... wrote: Hi all, I'm starting an evaluation of the AdvancedDataGrid and Flex 3 as whole for my project team which has a large financial application built currently in Flex 2. We were very anxious to apply the AdvancedDataGrid to provide grouping and summing against one of our large DataGrids and have found the performance far too poor to use on anything larger than a trivial dataset. The GroupingCollection's source is an ArrayCollection loaded from an HTTPService. It has 3700 records, each with 20 columns. We've found that we can create the collection with only one GroupingField, with 3 different SummaryFields being summed and the GroupingCollection.refresh() executes on average of 9 seconds. However to really gain buy-in for this feature, we want to group/sum on two different values and thus two GroupingFields, each with the same SummaryRow and SummaryFields. In this case performance drops to an average 123 seconds for GroupingCollection.refresh(). Completely unusable especially as we get a Flex timeout in the browser after 15 seconds. One more bit of information is that in cutting the size of each record down to 5 columns instead of 20, the refresh() only averages 8 seconds even with 2 GroupingFields (and still the 3700 rows!). Something is very wrong here as grouping/summing should really depend upon the number of entries in the ArrayCollection, NOT the number of fields in each entry in the ArrayCollection. Finally, this functionality only seems to work with object as the result format for the HTTPService. If I use e4x (as all of the existing services in our application do), wrap the XMLList returned as an XMLListCollection to use as the GroupingCollection's source, even with just one GroupingField it averages 98 seconds. I'm going to start digging into the GroupingCollection source, but I'm not optimistic. Does anyone have tips or hints as to anything that can help optimize this process? Or any further info from Adobe about known performance issues with AdvancedDataGrid/GroupingCollection? Thanks so much, any help is greatly appreciated! Regards, Jason Have there been any improvements made to GroupingCollection performance since this posting?
[flexcoders] Re: AdvancedDataGrid, calling a sort on a column without a hidden header.
Just sort the collection that the grid is bound to. --- In flexcoders@yahoogroups.com, djhatrick djhatr...@... wrote: How do i duplicate the functionality of of sorting an advancedDatagrid without a header release event. I'd like to sort my IHierarchicalCollectionView recursively. Thanks, Patrick
[flexcoders] Re: AdvancedDatagrid
Thank Tracy and Tim, your code is great. I have seen what I want. Thank very much. --- In flexcoders@yahoogroups.com, Tim Hoff timh...@... wrote: event.itemRenderer.data -TH --- In flexcoders@yahoogroups.com, lehaianh1986 lehaianh1986@ wrote: I use the line to test. It show the row index in advanceddatagrid that I want to select. What I need is data of object in each row I select. But how to give it? --- In flexcoders@yahoogroups.com, Tracy Spratt tspratt@ wrote: What are you trying to do with the line?: AdvancedDataGrid(event.currentTarget).selectedIndex = event.rowIndex; As it is is sets the selectedIndex to itself. rowIndex is the selectedIndex. Tracy Spratt, Lariat Services, development services available _ From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of lehaianh1986 Sent: Monday, March 30, 2009 10:29 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: AdvancedDatagrid Yeah I see. Thank you very much. I still have small question To give index of row I use AdvancedDataGrid(event.currentTarget).selectedIndex = event.rowIndex; But to give data of it, how do I do? --- In flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com, Tim Hoff TimHoff@ wrote: Missed the return void. private function myEventHandler( event:ListEvent ):void { // do something } -TH --- In flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com, Tim Hoff TimHoff@ wrote: Just a syntax problem. Should be like this: var client:AdvancedDataGrid = new AdvancedDataGrid; client.dataProvider = ArrayResults; client.addEventListener( ListEvent.ITEM_CLICK , myEventHandler ); private function myEventHandler( event:ListEvent ) { // do something } -TH Also, I'd suggest that you use an ArrayCollection instead of an array; if you want to do any data manipulation. --- In flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com, lehaianh1986 lehaianh1986@ wrote: Hi every body. I have a AdvancedDatagird and dataprovider from Array Collection. How to listen an event when I click to each row? I want use an event when I click left mouse, right mouse, double click,...etc My code is here but it not run var client:AdvancedDataGrid = new AdvancedDataGrid; client.dataProvider = ArrayResults; client.addEventListener(ListEvent.ITEM_CLICK,function(event:ListEvent):v\ \ \ oid { ... });
[flexcoders] Re: AdvancedDatagrid
Just a syntax problem. Should be like this: var client:AdvancedDataGrid = new AdvancedDataGrid; client.dataProvider = ArrayResults; client.addEventListener( ListEvent.ITEM_CLICK , myEventHandler ); private function myEventHandler( event:ListEvent ) { // do something } -TH Also, I'd suggest that you use an ArrayCollection instead of an array; if you want to do any data manipulation. --- In flexcoders@yahoogroups.com, lehaianh1986 lehaianh1...@... wrote: Hi every body. I have a AdvancedDatagird and dataprovider from Array Collection. How to listen an event when I click to each row? I want use an event when I click left mouse, right mouse, double click,...etc My code is here but it not run var client:AdvancedDataGrid = new AdvancedDataGrid; client.dataProvider = ArrayResults; client.addEventListener(ListEvent.ITEM_CLICK,function(event:ListEvent):v\ oid { ... });
[flexcoders] Re: AdvancedDatagrid
Missed the return void. private function myEventHandler( event:ListEvent ):void { // do something } -TH --- In flexcoders@yahoogroups.com, Tim Hoff timh...@... wrote: Just a syntax problem. Should be like this: var client:AdvancedDataGrid = new AdvancedDataGrid; client.dataProvider = ArrayResults; client.addEventListener( ListEvent.ITEM_CLICK , myEventHandler ); private function myEventHandler( event:ListEvent ) { // do something } -TH Also, I'd suggest that you use an ArrayCollection instead of an array; if you want to do any data manipulation. --- In flexcoders@yahoogroups.com, lehaianh1986 lehaianh1986@ wrote: Hi every body. I have a AdvancedDatagird and dataprovider from Array Collection. How to listen an event when I click to each row? I want use an event when I click left mouse, right mouse, double click,...etc My code is here but it not run var client:AdvancedDataGrid = new AdvancedDataGrid; client.dataProvider = ArrayResults; client.addEventListener(ListEvent.ITEM_CLICK,function(event:ListEvent):v\ \ oid { ... });
[flexcoders] Re: AdvancedDatagrid
Yeah I see. Thank you very much. I still have small question To give index of row I use AdvancedDataGrid(event.currentTarget).selectedIndex = event.rowIndex; But to give data of it, how do I do? --- In flexcoders@yahoogroups.com, Tim Hoff timh...@... wrote: Missed the return void. private function myEventHandler( event:ListEvent ):void { // do something } -TH --- In flexcoders@yahoogroups.com, Tim Hoff TimHoff@ wrote: Just a syntax problem. Should be like this: var client:AdvancedDataGrid = new AdvancedDataGrid; client.dataProvider = ArrayResults; client.addEventListener( ListEvent.ITEM_CLICK , myEventHandler ); private function myEventHandler( event:ListEvent ) { // do something } -TH Also, I'd suggest that you use an ArrayCollection instead of an array; if you want to do any data manipulation. --- In flexcoders@yahoogroups.com, lehaianh1986 lehaianh1986@ wrote: Hi every body. I have a AdvancedDatagird and dataprovider from Array Collection. How to listen an event when I click to each row? I want use an event when I click left mouse, right mouse, double click,...etc My code is here but it not run var client:AdvancedDataGrid = new AdvancedDataGrid; client.dataProvider = ArrayResults; client.addEventListener(ListEvent.ITEM_CLICK,function(event:ListEvent):v\ \ oid { ... });
RE: [flexcoders] Re: AdvancedDatagrid
What are you trying to do with the line?: AdvancedDataGrid(event.currentTarget).selectedIndex = event.rowIndex; As it is is sets the selectedIndex to itself. rowIndex is the selectedIndex. Tracy Spratt, Lariat Services, development services available _ From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of lehaianh1986 Sent: Monday, March 30, 2009 10:29 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: AdvancedDatagrid Yeah I see. Thank you very much. I still have small question To give index of row I use AdvancedDataGrid(event.currentTarget).selectedIndex = event.rowIndex; But to give data of it, how do I do? --- In flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com, Tim Hoff timh...@... wrote: Missed the return void. private function myEventHandler( event:ListEvent ):void { // do something } -TH --- In flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com, Tim Hoff TimHoff@ wrote: Just a syntax problem. Should be like this: var client:AdvancedDataGrid = new AdvancedDataGrid; client.dataProvider = ArrayResults; client.addEventListener( ListEvent.ITEM_CLICK , myEventHandler ); private function myEventHandler( event:ListEvent ) { // do something } -TH Also, I'd suggest that you use an ArrayCollection instead of an array; if you want to do any data manipulation. --- In flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com, lehaianh1986 lehaianh1986@ wrote: Hi every body. I have a AdvancedDatagird and dataprovider from Array Collection. How to listen an event when I click to each row? I want use an event when I click left mouse, right mouse, double click,...etc My code is here but it not run var client:AdvancedDataGrid = new AdvancedDataGrid; client.dataProvider = ArrayResults; client.addEventListener(ListEvent.ITEM_CLICK,function(event:ListEvent):v\ \ oid { ... });
[flexcoders] Re: AdvancedDatagrid
event.itemRenderer.data -TH --- In flexcoders@yahoogroups.com, lehaianh1986 lehaianh1...@... wrote: I use the line to test. It show the row index in advanceddatagrid that I want to select. What I need is data of object in each row I select. But how to give it? --- In flexcoders@yahoogroups.com, Tracy Spratt tspratt@ wrote: What are you trying to do with the line?: AdvancedDataGrid(event.currentTarget).selectedIndex = event.rowIndex; As it is is sets the selectedIndex to itself. rowIndex is the selectedIndex. Tracy Spratt, Lariat Services, development services available _ From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of lehaianh1986 Sent: Monday, March 30, 2009 10:29 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: AdvancedDatagrid Yeah I see. Thank you very much. I still have small question To give index of row I use AdvancedDataGrid(event.currentTarget).selectedIndex = event.rowIndex; But to give data of it, how do I do? --- In flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com, Tim Hoff TimHoff@ wrote: Missed the return void. private function myEventHandler( event:ListEvent ):void { // do something } -TH --- In flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com, Tim Hoff TimHoff@ wrote: Just a syntax problem. Should be like this: var client:AdvancedDataGrid = new AdvancedDataGrid; client.dataProvider = ArrayResults; client.addEventListener( ListEvent.ITEM_CLICK , myEventHandler ); private function myEventHandler( event:ListEvent ) { // do something } -TH Also, I'd suggest that you use an ArrayCollection instead of an array; if you want to do any data manipulation. --- In flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com, lehaianh1986 lehaianh1986@ wrote: Hi every body. I have a AdvancedDatagird and dataprovider from Array Collection. How to listen an event when I click to each row? I want use an event when I click left mouse, right mouse, double click,...etc My code is here but it not run var client:AdvancedDataGrid = new AdvancedDataGrid; client.dataProvider = ArrayResults; client.addEventListener(ListEvent.ITEM_CLICK,function(event:ListEvent):v\ \ \ oid { ... });
RE: [flexcoders] Re: AdvancedDatagrid
Use : event.currentTarget.selectedItem; That will return a reference to the currently selected item object in the dataProvider. Alternatively, you could do: ArrayResults.getItemAt(event.CurrentTarget.selectedIndex) Tracy Spratt, Lariat Services, development services available _ From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of lehaianh1986 Sent: Monday, March 30, 2009 10:50 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: AdvancedDatagrid I use the line to test. It show the row index in advanceddatagrid that I want to select. What I need is data of object in each row I select. But how to give it? --- In flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com, Tracy Spratt tspr...@... wrote: What are you trying to do with the line?: AdvancedDataGrid(event.currentTarget).selectedIndex = event.rowIndex; As it is is sets the selectedIndex to itself. rowIndex is the selectedIndex. Tracy Spratt, Lariat Services, development services available _ From: flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com [mailto:flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com] On Behalf Of lehaianh1986 Sent: Monday, March 30, 2009 10:29 PM To: flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com Subject: [flexcoders] Re: AdvancedDatagrid Yeah I see. Thank you very much. I still have small question To give index of row I use AdvancedDataGrid(event.currentTarget).selectedIndex = event.rowIndex; But to give data of it, how do I do? --- In flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com, Tim Hoff TimHoff@ wrote: Missed the return void. private function myEventHandler( event:ListEvent ):void { // do something } -TH --- In flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com, Tim Hoff TimHoff@ wrote: Just a syntax problem. Should be like this: var client:AdvancedDataGrid = new AdvancedDataGrid; client.dataProvider = ArrayResults; client.addEventListener( ListEvent.ITEM_CLICK , myEventHandler ); private function myEventHandler( event:ListEvent ) { // do something } -TH Also, I'd suggest that you use an ArrayCollection instead of an array; if you want to do any data manipulation. --- In flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com, lehaianh1986 lehaianh1986@ wrote: Hi every body. I have a AdvancedDatagird and dataprovider from Array Collection. How to listen an event when I click to each row? I want use an event when I click left mouse, right mouse, double click,...etc My code is here but it not run var client:AdvancedDataGrid = new AdvancedDataGrid; client.dataProvider = ArrayResults; client.addEventListener(ListEvent.ITEM_CLICK,function(event:ListEvent):v\ \ oid { ... });
[flexcoders] Re: AdvancedDatagrid
I use the line to test. It show the row index in advanceddatagrid that I want to select. What I need is data of object in each row I select. But how to give it? --- In flexcoders@yahoogroups.com, Tracy Spratt tspr...@... wrote: What are you trying to do with the line?: AdvancedDataGrid(event.currentTarget).selectedIndex = event.rowIndex; As it is is sets the selectedIndex to itself. rowIndex is the selectedIndex. Tracy Spratt, Lariat Services, development services available _ From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of lehaianh1986 Sent: Monday, March 30, 2009 10:29 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: AdvancedDatagrid Yeah I see. Thank you very much. I still have small question To give index of row I use AdvancedDataGrid(event.currentTarget).selectedIndex = event.rowIndex; But to give data of it, how do I do? --- In flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com, Tim Hoff TimHoff@ wrote: Missed the return void. private function myEventHandler( event:ListEvent ):void { // do something } -TH --- In flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com, Tim Hoff TimHoff@ wrote: Just a syntax problem. Should be like this: var client:AdvancedDataGrid = new AdvancedDataGrid; client.dataProvider = ArrayResults; client.addEventListener( ListEvent.ITEM_CLICK , myEventHandler ); private function myEventHandler( event:ListEvent ) { // do something } -TH Also, I'd suggest that you use an ArrayCollection instead of an array; if you want to do any data manipulation. --- In flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com, lehaianh1986 lehaianh1986@ wrote: Hi every body. I have a AdvancedDatagird and dataprovider from Array Collection. How to listen an event when I click to each row? I want use an event when I click left mouse, right mouse, double click,...etc My code is here but it not run var client:AdvancedDataGrid = new AdvancedDataGrid; client.dataProvider = ArrayResults; client.addEventListener(ListEvent.ITEM_CLICK,function(event:ListEvent):v\ \ oid { ... });
[flexcoders] Re: AdvancedDatagrid static row for totals.
Sadly it's wishful thinking. I accomplished it by adding a totals row to my data provider and then performed custom sorts in order to keep the totals line always at the bottom. Since the sort compare function doesn't pass in the column you have to maintain a reference of what kind of sort (ascending/descending) and which column is being sorted. Sadly an NDA prevents me from copy/pasting the code I have but I hope to write up a nice rant soon about it, complete with example code. It really is a pain. Here's hoping for a better ADG in gumbo. Justin Nichols Sent from my iPhone
[flexcoders] Re: AdvancedDatagrid static row for totals.
Hello??? --- In flexcoders@yahoogroups.com, aceoohay pa...@... wrote: I have finally switched to Flex 3, and one of the reasons I have done this is to make use of the ADG. In a number of places throughout my apps I have used Alex's FooterDataGrid and it works reasonably well. I was under the impression that one of the features of the ADG was going to be static rows for totals, or whatever you might need. I have not found that capability. Was it wishful thinking, or is the feature there and I just can't find it? Anyone info about this would be greatly appreciated. Paul
RE: [flexcoders] Re: AdvancedDatagrid static row for totals.
You got a few responses, including one very short one from me. The short answer is no. Tracy Spratt Lariat Services Flex development bandwidth available From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of aceoohay Sent: Tuesday, February 03, 2009 6:08 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: AdvancedDatagrid static row for totals. Hello??? --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , aceoohay pa...@... wrote: I have finally switched to Flex 3, and one of the reasons I have done this is to make use of the ADG. In a number of places throughout my apps I have used Alex's FooterDataGrid and it works reasonably well. I was under the impression that one of the features of the ADG was going to be static rows for totals, or whatever you might need. I have not found that capability. Was it wishful thinking, or is the feature there and I just can't find it? Anyone info about this would be greatly appreciated. Paul
[flexcoders] Re: AdvancedDataGrid group filtering openNode
I am having the same problem and can't find a solution. Has anyone solved this? Angela --- In flexcoders@yahoogroups.com, Eric Jones gig...@... wrote: Adnan or Nigel, Did either of you resolve this? Any change you could post a solution? jonese --- In flexcoders@yahoogroups.com, nigelrmtaylor ntaylor@ wrote: Adnan Did you get any further with this? It looks like I'm trying to solve the same problem as you. Cheers Nigel --- In flexcoders@yahoogroups.com, Adnan Doric astronaute@ wrote: Hello guys, I'm trying to filter my ADG without success : I created a GroupingCollection from a flat ArrayCollection. ADG's dataProvider is GroupingCollection. First issue : refresh if I filter the underlaying ArrayCollection, the related groupingCollection doesn't refresh automatically (bug? feature?) Actually I menaged to force gc.refresh() with some event( it is impossible to listen on CollectionEventKind.REFRESH because of infinite loop ac.refresh = gc.refresh ) Second issue (more important) : openNodes Ok now that my gc is refreshed, the Tree in the ADG collapses itself (ok let say that is normal), and I need it to expand all nodes that were opened before. I tried to do something like this : var openNodes : Object = IHierarchicalCollectionView( myADG.dataProvider ).openNodes; gc.refresh(); myADG.dataProvider.openNodes = openNodes; and it doesn't works. next I tried this : var openNodes : Object = IHierarchicalCollectionView( myADG.dataProvider ).openNodes; for each( var node : Object in openNodes ) { IHierarchicalCollectionView( myADG.dataProvider.openNode( node ) } guess what, doesn't work :) I'm calling myADG.invalidateList() each time too. I don't know what to do to achieve this simple task, I'm a bit disappointed because I expected lot more from the brand new AdvancedDataGrid and this basic functionality actually seems too hard to implement. I still hope I'm wrong and someone can show me the correct solution :) Thank you all, Adnan
Re: [flexcoders] Re: AdvancedDataGrid group filtering openNode
Hi folks, We actually have the same need and including the things y'all have already tried, we even tried to cycle thru the open nodes and write their object to an array, then refreshed then tried to do an open nodes for each in the array without success Alex, et al...any input to this one because it seems like a lot of folks need it! Best, Adrian Angela wrote: I am having the same problem and can't find a solution. Has anyone solved this? Angela --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com, Eric Jones gig...@... wrote: Adnan or Nigel, Did either of you resolve this? Any change you could post a solution? jonese --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com, nigelrmtaylor ntaylor@ wrote: Adnan Did you get any further with this? It looks like I'm trying to solve the same problem as you. Cheers Nigel --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com, Adnan Doric astronaute@ wrote: Hello guys, I'm trying to filter my ADG without success : I created a GroupingCollection from a flat ArrayCollection. ADG's dataProvider is GroupingCollection. First issue : refresh if I filter the underlaying ArrayCollection, the related groupingCollection doesn't refresh automatically (bug? feature?) Actually I menaged to force gc.refresh() with some event( it is impossible to listen on CollectionEventKind.REFRESH because of infinite loop ac.refresh = gc.refresh ) Second issue (more important) : openNodes Ok now that my gc is refreshed, the Tree in the ADG collapses itself (ok let say that is normal), and I need it to expand all nodes that were opened before. I tried to do something like this : var openNodes : Object = IHierarchicalCollectionView( myADG.dataProvider ).openNodes; gc.refresh(); myADG.dataProvider.openNodes = openNodes; and it doesn't works. next I tried this : var openNodes : Object = IHierarchicalCollectionView( myADG.dataProvider ).openNodes; for each( var node : Object in openNodes ) { IHierarchicalCollectionView( myADG.dataProvider.openNode( node ) } guess what, doesn't work :) I'm calling myADG.invalidateList() each time too. I don't know what to do to achieve this simple task, I'm a bit disappointed because I expected lot more from the brand new AdvancedDataGrid and this basic functionality actually seems too hard to implement. I still hope I'm wrong and someone can show me the correct solution :) Thank you all, Adnan
[flexcoders] Re: AdvancedDataGrid itemIcons
Look at setting the following parameters null on AdvancedDataGrid object: folderOpenIcon={null} folderClosedIcon={null} defaultLeafIcon={null} ~Chris --- In flexcoders@yahoogroups.com, Bill bill.frank...@... wrote: What would be the best way to remove the itemIcons from the AdvancedDataGrid?
[flexcoders] Re: AdvancedDataGrid itemIcons
--- In flexcoders@yahoogroups.com, c_higgon higdonchristoph...@... wrote: Look at setting the following parameters null on AdvancedDataGrid object: folderOpenIcon={null} folderClosedIcon={null} defaultLeafIcon={null} ~Chris --- In flexcoders@yahoogroups.com, Bill bill.franklin@ wrote: What would be the best way to remove the itemIcons from the AdvancedDataGrid? I was missing the defaultLeafIcon. Thanks. itemIcons is misleading in this regard to me.
[flexcoders] Re: AdvancedDataGrid Tree - Help Required - Urgent
--- In flexcoders@yahoogroups.com, muruga murugave...@... wrote: Hi Thank you very much for your reply. Is it possible to get some sample code for this? My agreement with my client does not permit this. Sorry
[flexcoders] Re: AdvancedDataGrid Tree - Help Required - Urgent
--- In flexcoders@yahoogroups.com, muruga murugave...@... wrote: Hi I have advanceddatagrid in which i am displaying the data in Tree structure. Since the data is huge and it is taking lots of time to retrieve from databse, we wanted build the tree dynamically. Means initially we want to display the tree only will the parent nodes. Only when the user expands the parent node, we need to build the children node of this parent node (only when the user expands the parent node, we go to DB and retrieve the children node details). Is it possible to do this with FLEX advanceddatagrid tree structure. First i would like to know, is it feasible to do? if yes, then how to do it. It is very urgent. I've done this, not with an AdvancedDatagrid, but with a HierarchicalCollectionView, which is what an ADG dataProvider is. Essentially, I called a service that gave me the top level of the hierarchy. The objects that populate the HierarchicalCollectionView each have a method that loads the children. I don't wait for the user to open the nodes. Instead, I start loading the children in the background by calling this method as soon as the top level is known. The child object will generate an event when its children are loaded, and then the parent class (which has the HierarchichalCollectionView as a property) will call the next child in the line. If a user selects a child that has not loaded its children yet, when the event fires that says the last child was loaded, I interrupt the predictive load to load that one. This has been discussed recently on here, and I think the person who was doing this type of load on a Tree control had to do something once the load was complete to tell the node to open. HTH; Amy
[flexcoders] Re: AdvancedDataGrid grouping name gets cut off if the first column is thin
Do you mean column spanning? If so, according to the docs at http://livedocs.adobe.com/flex/3/html/help.html?content=advdatagrid_10.html you can Span multiple columns with a renderer --- In flexcoders@yahoogroups.com, blc187 [EMAIL PROTECTED] wrote: Does anyone have any experience using AdvancedDataGrids? I would like the row that displays the folder and the grouping name to span the entire datagrid. For example, I have a data set that creates 3 groups titled Group 1, Group 2, Group 3. Each of these nodes has items underneath of it. I've noticed that the columns apply to the row with the folder and the group name, not just the items below each, so that if my group's name is long it gets ellipsed (...) if the first column is short. Is there any way I can extend this across the entire row. Does that make sense? I realize it's a bit of a tricky situation to explain...
[flexcoders] Re: AdvancedDataGrid grouping name gets cut off if the first column is thin
I'm afraid I don't have the Pro version of Flex (No Advanced Data Grid and no Data Visualization) so I'll have to leave further discussion to someone who does. Sorry I can't be more help. --- In flexcoders@yahoogroups.com, blc187 [EMAIL PROTECTED] wrote: Yes, I do mean spanning multiple columns. And I am using column renderers and renderer providers. But I'd like to be able to span multiple columns in the row that is the group folder, not just the individual item rows. --- In flexcoders@yahoogroups.com, valdhor stevedepp@ wrote: Do you mean column spanning? If so, according to the docs at http://livedocs.adobe.com/flex/3/html/help.html? content=advdatagrid_10.html you can Span multiple columns with a renderer --- In flexcoders@yahoogroups.com, blc187 blc187@ wrote: Does anyone have any experience using AdvancedDataGrids? I would like the row that displays the folder and the grouping name to span the entire datagrid. For example, I have a data set that creates 3 groups titled Group 1, Group 2, Group 3. Each of these nodes has items underneath of it. I've noticed that the columns apply to the row with the folder and the group name, not just the items below each, so that if my group's name is long it gets ellipsed (...) if the first column is short. Is there any way I can extend this across the entire row. Does that make sense? I realize it's a bit of a tricky situation to explain...
[flexcoders] Re: AdvancedDataGrid grouping name gets cut off if the first column is thin
Yes, I do mean spanning multiple columns. And I am using column renderers and renderer providers. But I'd like to be able to span multiple columns in the row that is the group folder, not just the individual item rows. --- In flexcoders@yahoogroups.com, valdhor [EMAIL PROTECTED] wrote: Do you mean column spanning? If so, according to the docs at http://livedocs.adobe.com/flex/3/html/help.html? content=advdatagrid_10.html you can Span multiple columns with a renderer --- In flexcoders@yahoogroups.com, blc187 blc187@ wrote: Does anyone have any experience using AdvancedDataGrids? I would like the row that displays the folder and the grouping name to span the entire datagrid. For example, I have a data set that creates 3 groups titled Group 1, Group 2, Group 3. Each of these nodes has items underneath of it. I've noticed that the columns apply to the row with the folder and the group name, not just the items below each, so that if my group's name is long it gets ellipsed (...) if the first column is short. Is there any way I can extend this across the entire row. Does that make sense? I realize it's a bit of a tricky situation to explain...
[flexcoders] Re: AdvancedDataGrid not redrawing properly
Anyone?? This is really driving me crazy! --- In flexcoders@yahoogroups.com, Randy Martin [EMAIL PROTECTED] wrote: I have an AdvancedDataGrid in an application in one of the states. The first time I display it, everything is fine. If I subsequently enter another state and then redisplay the AdvancedDataGrid, it shows up without any borders or grid lines. As soon as I populate it (assign a data provider), the borders and grid lines reappear. Anyone have any idea what's going on here? TIA, ~randy
[flexcoders] Re: AdvancedDataGrid update problems
I'll speculate openly in case someone picks up on this. Could there be some sort of race condition in the way AdvancedDataGrid works. Ie. redraws or updates the scroll bar too early in reaction to sorting? (ie. before the collection has had a chance to finish sorting itself) Is this kind of bug even possible in the flash runtime, keeping in mind that it is single-threaded? --- In flexcoders@yahoogroups.com, kallebertell [EMAIL PROTECTED] wrote: I'm facing a problem where an advanced data grid (adg) with a hierarchical collection (~500-1000 rows) doesn't redraw properly after sorting is applied to the underlying collection. The fun bit is that it isn't reproduceable. The occurance seems to be completely random but somehow related to sorting, as it seems to rear it's head only then (but not always). Scrolling after the adg is messed up doesn't improve it either, but at some point causes null reference exceptions onMouseRollOver. The advanced data grid is in a minimiziable container. If the container is minimized and then restored, the adg looks normal again (ie. redraws correctly). Although this rarely happens on my dev machine it happens more often for our customers, which might indicate that it's more frequent on slower machines. I'm looking for any clue or people who have also experienced this weird behaviour in adg. Thanks.
[flexcoders] Re: AdvancedDataGrid update problems
I finally managed to reproduce the bug (or one of the bugs). By scrolling to the very bottom and sorting according to any column, it seems to sort, but the last items seen in the grid shouldn't be last. Turns out the grid just hasn't updated the view properly or too early somehow. A delayed call to invalidateList after sorting seems at first to fix this, but it's possible to get the grid into an invalid state despite this. Dispatching a reset event seemed better. Would be nice to figure out the cause since this bandage solution hurts my eyes. --- In flexcoders@yahoogroups.com, kallebertell [EMAIL PROTECTED] wrote: I'll speculate openly in case someone picks up on this. Could there be some sort of race condition in the way AdvancedDataGrid works. Ie. redraws or updates the scroll bar too early in reaction to sorting? (ie. before the collection has had a chance to finish sorting itself) Is this kind of bug even possible in the flash runtime, keeping in mind that it is single-threaded? --- In flexcoders@yahoogroups.com, kallebertell kallebertell@ wrote: I'm facing a problem where an advanced data grid (adg) with a hierarchical collection (~500-1000 rows) doesn't redraw properly after sorting is applied to the underlying collection. The fun bit is that it isn't reproduceable. The occurance seems to be completely random but somehow related to sorting, as it seems to rear it's head only then (but not always). Scrolling after the adg is messed up doesn't improve it either, but at some point causes null reference exceptions onMouseRollOver. The advanced data grid is in a minimiziable container. If the container is minimized and then restored, the adg looks normal again (ie. redraws correctly). Although this rarely happens on my dev machine it happens more often for our customers, which might indicate that it's more frequent on slower machines. I'm looking for any clue or people who have also experienced this weird behaviour in adg. Thanks.
[flexcoders] Re: AdvancedDataGrid: Exclude last row from sorting
I'm glad I ran across this post it really helped me with my current project. I am having another problem that I had hoped this would fix but it didn't so I figured this was a good place to ask. My AdvancedDataGrid with a summaryRow will only sort any column once. If I try to sort the same column a second time it seems to freeze the sorting on that column and the rest. The arrow changes, showing ascending/descending but the data remains in the same order. Can anyone see a problem with this code, or maybe have run into the same thing? ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=vertical themeColor=#FFE600 creationComplete=getXML.send(); getXML2.send() backgroundColor=#FF mx:Style source=css/global.css/ mx:Script ![CDATA[ import mx.collections.Sort; import mx.collections.SortField; import mx.controls.advancedDataGridClasses.AdvancedDataGridColumn; import mx.collections.GroupingCollection; import mx.collections.Grouping; import mx.collections.GroupingField; import mx.collections.HierarchicalData; import flash.events.Event; import mx.collections.ArrayCollection; import mx.rpc.events.ResultEvent; // [Bindable] [Embed(source=images/plus.png)] public var plus:Class; [Bindable] [Embed(source=images/minus.png)] public var minus:Class; // [Bindable] public var myData:ArrayCollection = new ArrayCollection(); [Bindable] public var myData2:ArrayCollection = new ArrayCollection(); // public function extractData(event:ResultEvent):void{ myData = event.result.people.person; } public function extractData2(event:ResultEvent):void{ myData2 = event.result.people.project; handleFilterSearch(); gcPerson.refresh(); } // The Sort object used to sort the collection. private var sortA:Sort // The sort fields used to determine the sort. private var sortByName:SortField; private var sortByProject:SortField; private var sortByDate:SortField; // private function handleFilterSearch():void{ sortA = new Sort(); sortByName = new SortField(name, true, false, false); sortByProject = new SortField(title, true, false, false); sortByDate = new SortField(month, true, false, false); sortA.fields=[sortByDate]; myData2.sort=sortA; //refresh myData2.refresh(); } // // private function getMonth(a:Object, b:Object, fields:Array=null):int { if (a.month == b.month)return 0; if (a.month b.month) { return 1; } else { return -1; } } // // // private function sortNumbers(obj1:Object, obj2:Object):int { if (obj1.summaryRow) return col1.sortDescending ? -1 : 1 else if (obj2.summaryRow) return col1.sortDescending ? 1 : -1 else if (obj1.value obj2.value) return -1 else if (obj1.value obj2.value) return 1 else return 0; } ]] /mx:Script !-- //// // SERVICE // //// -- mx:HTTPService id=getXML url=projectHours.xml result=extractData (event) showBusyCursor=true/ !-- //// // DATE // //// -- mx:DateFormatter id=myDate formatString= / mx:HTTPService id=getXML2 url=projectHours2.xml result=extractData2(event); gcPerson.refresh()/ mx:HBox width=100% mx:Button label=Group on Person click=groupOnPerson() / mx:Button label=Group on Project click=groupOnProject () / mx:Spacer width=25/ mx:Button label=Expand All click=myADG.expandAll() / mx:Button label=Colapse All click=myADG.collapseAll() / /mx:HBox !-- //// //ADG // //// -- mx:AdvancedDataGrid id=myADG width=100% height=100% initialize=gcPerson.refresh() folderClosedIcon={null} folderOpenIcon={null} disclosureClosedIcon={plus} disclosureOpenIcon={minus} horizontalGridLines=true horizontalGridLineColor=#CC sortExpertMode=true mx:dataProvider mx:GroupingCollection id=gcPerson source={myData2} mx:grouping mx:Grouping mx:GroupingField name=name / mx:GroupingField name=title mx:SummaryRow summaryPlacement=group mx:fields mx:SummaryField operation=COUNT dataField=title / /mx:fields /mx:SummaryRow mx:SummaryRow summaryPlacement=last mx:fields mx:SummaryField operation=SUM dataField=projectedHours label=summaryPro / mx:SummaryField operation=SUM dataField=actualHours label=summary / /mx:fields /mx:SummaryRow
[flexcoders] Re: AdvancedDataGrid changing background color of Group Headers
--- In flexcoders@yahoogroups.com, anandvardhan.flex [EMAIL PROTECTED] wrote: Hi, But it is not going to solve my issue. The issue is to change color of only that row which has other childs in it. So when your styleFunction gets the reference to the data object, you're telling me that there is absolutely _nothing_ in that data that gives you any clue as to whether it is a parent or a child? At all? -Amy
[flexcoders] Re: AdvancedDataGrid changing background color of Group Headers
--- In flexcoders@yahoogroups.com, anandvardhan.flex [EMAIL PROTECTED] wrote: I need to access the first row of each group in AdvancedDataGrid, and change its background color. is there any way to do it. I found one way accessing the column using GroupItemRenderer but it only controls the column which groups the grid. The data property of your itemRenderer will contain the same information regardless of column. HTH; Amy
[flexcoders] Re: AdvancedDataGrid changing background color of Group Headers
Hi, But it is not going to solve my issue. The issue is to change color of only that row which has other childs in it. Anand --- In flexcoders@yahoogroups.com, Amy [EMAIL PROTECTED] wrote: --- In flexcoders@yahoogroups.com, anandvardhan.flex anandvardhan.flex@ wrote: I need to access the first row of each group in AdvancedDataGrid, and change its background color. is there any way to do it. I found one way accessing the column using GroupItemRenderer but it only controls the column which groups the grid. The data property of your itemRenderer will contain the same information regardless of column. HTH; Amy
[flexcoders] Re: AdvancedDataGrid - help displaying custom data objects
so to get things to show up as I wanted I had to add a children property to my EmployeeGroup (didn't see that anywhere in the documentation, but I noticed the Adobe examples have children properties). So I added this in the EmployeeGroup: pre public function get children():ArrayCollection { var kids:ArrayCollection = new ArrayCollection(); for (var i:int=0; i groups.length; i++) { kids.addItem(groups[i]); } for (var i:int=0; i employees.length; i++) { kids.addItem(employees[i]); } return kids; } /pre Obviously it can be more efficient, but it works..which is the start!
[flexcoders] Re: AdvancedDataGrid layout problem
--- In flexcoders@yahoogroups.com, whatabrain [EMAIL PROTECTED] wrote: I'm having trouble laying out my AdvancedDataGrid. I would like to have a tree with a depth of 1 (a root node only contains leaf nodes). The rootnode is just the expand/collapse icon, followed by a name. The leaf nodes have several columns, the first few of which are very narrow. Basically, I want the root nodes to ignore the column structure of the leaf nodes. Something like a colspan in HTML. Hide the vertical separator between the columns. If you need it for the leaf nodes, add it into the itemRenderers. HTH; Amy
[flexcoders] Re: AdvancedDataGrid layout problem
I'm actually already hiding all the grid separators. Let me try to demonstrate what I mean visually... This is what I want: [^] Group1 [ ] C1 C2 C3 C4 C5 [ ] C1 C2 C3 C4 C5 [ ] C1 C2 C3 C4 C5 In the above picture, each item (C1,C2,etc) is in its own column, but the group name ignores those columns. Because of the way columns are aligned, this is what I'm actually seeing: [^]G [ ] C1 C2 C3 C4 C5 [ ] C1 C2 C3 C4 C5 [ ] C1 C2 C3 C4 C5 The group name is cut off, because it doesn't fit in the very narrow first column. If I put the name in a wider column, it's indented too far. So how do I make the group name span all five columns, giving it enough space to display? --- In flexcoders@yahoogroups.com, Amy [EMAIL PROTECTED] wrote: --- In flexcoders@yahoogroups.com, whatabrain junk1@ wrote: I'm having trouble laying out my AdvancedDataGrid. I would like to have a tree with a depth of 1 (a root node only contains leaf nodes). The rootnode is just the expand/collapse icon, followed by a name. The leaf nodes have several columns, the first few of which are very narrow. Basically, I want the root nodes to ignore the column structure of the leaf nodes. Something like a colspan in HTML. Hide the vertical separator between the columns. If you need it for the leaf nodes, add it into the itemRenderers. HTH; Amy
[flexcoders] Re: AdvancedDataGrid layout problem
--- In flexcoders@yahoogroups.com, whatabrain [EMAIL PROTECTED] wrote: I'm actually already hiding all the grid separators. Let me try to demonstrate what I mean visually... This is what I want: [^] Group1 [ ] C1 C2 C3 C4 C5 [ ] C1 C2 C3 C4 C5 [ ] C1 C2 C3 C4 C5 In the above picture, each item (C1,C2,etc) is in its own column, but the group name ignores those columns. Because of the way columns are aligned, this is what I'm actually seeing: [^]G [ ] C1 C2 C3 C4 C5 [ ] C1 C2 C3 C4 C5 [ ] C1 C2 C3 C4 C5 The group name is cut off, because it doesn't fit in the very narrow first column. If I put the name in a wider column, it's indented too far. So how do I make the group name span all five columns, giving it enough space to display? From the Help: A renderer can span multiple columns. In the following example, you create a renderer that spans two columns: mx:AdvancedDataGrid mx:columns mx:AdvancedDataGridColumn dataField=Region/ mx:AdvancedDataGridColumn dataField=Territory_Rep headerText=Territory Rep/ mx:AdvancedDataGridColumn id=actCol dataField=Actual/ mx:AdvancedDataGridColumn dataField=Estimate/ /mx:columns mx:rendererProviders mx:AdvancedDataGridRendererProvider column={actCol} depth=3 columnSpan=2 renderer=myComponents.SummaryRenderer/ /mx:rendererProviders /mx:AdvancedDataGrid HTH; Amy
[flexcoders] Re: advanceddatagrid itemrenderer refering current column's data
--- In flexcoders@yahoogroups.com, hworke [EMAIL PROTECTED] wrote: Hi, in a advanceddatagrid I need to put same background color if the the cell value is not empty string. In the itemrenderer all I need to check is if the current column value is null or not. I know how to refer a value of the data object in the itemrenderer like: data.whateverParameter. But in this case I need to refer the current column value not a fixed parameter of the data object. How do I refer to the current column vale in the itemrenderer? If you implement IDropInListRenderer, you can get access to the DataGridListData properties. Also, AdvancedDataGrid supports a style function, that you can use from outside the ADG to set styles. For more on that http://flexdiary.blogspot.com/2008/06/musings-on- advanceddatagrid-part-1.html HTH; Amy
Re: [flexcoders] Re: advanceddatagrid itemrenderer refering current column's data
Hey Amy great getting an email from you. Man I guess you paid google : every time I search anything regarding ADG you blog pops up. :-) Thanks for taking time to share that with us. As I found all your examples are addressing the whole row, I needed something for individual cells. I tried to work with your code and put the itemrenderer in ADGColumn but did not work accordingly. My requirement is very simple: all my ADGColumn will have the same itemrenderer and if the Column source has a nonempty string it will put the background color else leave it as is. Regards On Mon, Jul 14, 2008 at 3:49 PM, Amy [EMAIL PROTECTED] wrote: --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, hworke [EMAIL PROTECTED] wrote: Hi, in a advanceddatagrid I need to put same background color if the the cell value is not empty string. In the itemrenderer all I need to check is if the current column value is null or not. I know how to refer a value of the data object in the itemrenderer like: data.whateverParameter. But in this case I need to refer the current column value not a fixed parameter of the data object. How do I refer to the current column vale in the itemrenderer? If you implement IDropInListRenderer, you can get access to the DataGridListData properties. Also, AdvancedDataGrid supports a style function, that you can use from outside the ADG to set styles. For more on that http://flexdiary.blogspot.com/2008/06/musings-on- advanceddatagrid-part-1.html HTH; Amy
RE: [flexcoders] Re: advanceddatagrid itemrenderer refering current column's data
The new styling in ADG might be a better way to do this. Tracy From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Vivian Richard Sent: Monday, July 14, 2008 7:42 PM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] Re: advanceddatagrid itemrenderer refering current column's data Hey Amy great getting an email from you. Man I guess you paid google : every time I search anything regarding ADG you blog pops up. :-) Thanks for taking time to share that with us. As I found all your examples are addressing the whole row, I needed something for individual cells. I tried to work with your code and put the itemrenderer in ADGColumn but did not work accordingly. My requirement is very simple: all my ADGColumn will have the same itemrenderer and if the Column source has a nonempty string it will put the background color else leave it as is. Regards On Mon, Jul 14, 2008 at 3:49 PM, Amy [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , hworke [EMAIL PROTECTED] wrote: Hi, in a advanceddatagrid I need to put same background color if the the cell value is not empty string. In the itemrenderer all I need to check is if the current column value is null or not. I know how to refer a value of the data object in the itemrenderer like: data.whateverParameter. But in this case I need to refer the current column value not a fixed parameter of the data object. How do I refer to the current column vale in the itemrenderer? If you implement IDropInListRenderer, you can get access to the DataGridListData properties. Also, AdvancedDataGrid supports a style function, that you can use from outside the ADG to set styles. For more on that http://flexdiary.blogspot.com/2008/06/musings-on- http://flexdiary.blogspot.com/2008/06/musings-on- advanceddatagrid-part-1.html HTH; Amy
Re: [flexcoders] Re: advanceddatagrid itemrenderer refering current column's data
Thanks for the response Tracy. By styling you are referring to the stylefunction? My understanding that that the stylefunction is only meant for the text not the background color. On Mon, Jul 14, 2008 at 5:04 PM, Tracy Spratt [EMAIL PROTECTED] wrote: The new styling in ADG might be a better way to do this. Tracy -- *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On Behalf Of *Vivian Richard *Sent:* Monday, July 14, 2008 7:42 PM *To:* flexcoders@yahoogroups.com *Subject:* Re: [flexcoders] Re: advanceddatagrid itemrenderer refering current column's data Hey Amy great getting an email from you. Man I guess you paid google : every time I search anything regarding ADG you blog pops up. :-) Thanks for taking time to share that with us. As I found all your examples are addressing the whole row, I needed something for individual cells. I tried to work with your code and put the itemrenderer in ADGColumn but did not work accordingly. My requirement is very simple: all my ADGColumn will have the same itemrenderer and if the Column source has a nonempty string it will put the background color else leave it as is. Regards On Mon, Jul 14, 2008 at 3:49 PM, Amy [EMAIL PROTECTED] wrote: --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, hworke [EMAIL PROTECTED] wrote: Hi, in a advanceddatagrid I need to put same background color if the the cell value is not empty string. In the itemrenderer all I need to check is if the current column value is null or not. I know how to refer a value of the data object in the itemrenderer like: data.whateverParameter. But in this case I need to refer the current column value not a fixed parameter of the data object. How do I refer to the current column vale in the itemrenderer? If you implement IDropInListRenderer, you can get access to the DataGridListData properties. Also, AdvancedDataGrid supports a style function, that you can use from outside the ADG to set styles. For more on that http://flexdiary.blogspot.com/2008/06/musings-on- advanceddatagrid-part-1.html HTH; Amy
RE: [flexcoders] Re: advanceddatagrid itemrenderer refering current column's data
Ohhh, yes, that is right, the default item render for ADG does not support a background color, sorry, I forgot that. So yeah, an item renderer looks like the way to go on that. Google this, surely someone has an example. From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Vivian Richard Sent: Monday, July 14, 2008 8:42 PM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] Re: advanceddatagrid itemrenderer refering current column's data Thanks for the response Tracy. By styling you are referring to the stylefunction? My understanding that that the stylefunction is only meant for the text not the background color. On Mon, Jul 14, 2008 at 5:04 PM, Tracy Spratt [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: The new styling in ADG might be a better way to do this. Tracy From: flexcoders@yahoogroups.com mailto:flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com mailto:flexcoders@yahoogroups.com ] On Behalf Of Vivian Richard Sent: Monday, July 14, 2008 7:42 PM To: flexcoders@yahoogroups.com mailto:flexcoders@yahoogroups.com Subject: Re: [flexcoders] Re: advanceddatagrid itemrenderer refering current column's data Hey Amy great getting an email from you. Man I guess you paid google : every time I search anything regarding ADG you blog pops up. :-) Thanks for taking time to share that with us. As I found all your examples are addressing the whole row, I needed something for individual cells. I tried to work with your code and put the itemrenderer in ADGColumn but did not work accordingly. My requirement is very simple: all my ADGColumn will have the same itemrenderer and if the Column source has a nonempty string it will put the background color else leave it as is. Regards On Mon, Jul 14, 2008 at 3:49 PM, Amy [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , hworke [EMAIL PROTECTED] wrote: Hi, in a advanceddatagrid I need to put same background color if the the cell value is not empty string. In the itemrenderer all I need to check is if the current column value is null or not. I know how to refer a value of the data object in the itemrenderer like: data.whateverParameter. But in this case I need to refer the current column value not a fixed parameter of the data object. How do I refer to the current column vale in the itemrenderer? If you implement IDropInListRenderer, you can get access to the DataGridListData properties. Also, AdvancedDataGrid supports a style function, that you can use from outside the ADG to set styles. For more on that http://flexdiary.blogspot.com/2008/06/musings-on- http://flexdiary.blogspot.com/2008/06/musings-on- advanceddatagrid-part-1.html HTH; Amy
RE: [flexcoders] Re: advanceddatagrid itemrenderer refering current column's data
Has anyone tried the background item renderers from my blog in ADG? From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Tracy Spratt Sent: Monday, July 14, 2008 5:59 PM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Re: advanceddatagrid itemrenderer refering current column's data Ohhh, yes, that is right, the default item render for ADG does not support a background color, sorry, I forgot that. So yeah, an item renderer looks like the way to go on that. Google this, surely someone has an example. From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Vivian Richard Sent: Monday, July 14, 2008 8:42 PM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] Re: advanceddatagrid itemrenderer refering current column's data Thanks for the response Tracy. By styling you are referring to the stylefunction? My understanding that that the stylefunction is only meant for the text not the background color. On Mon, Jul 14, 2008 at 5:04 PM, Tracy Spratt [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: The new styling in ADG might be a better way to do this. Tracy From: flexcoders@yahoogroups.com mailto:flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com mailto:flexcoders@yahoogroups.com ] On Behalf Of Vivian Richard Sent: Monday, July 14, 2008 7:42 PM To: flexcoders@yahoogroups.com mailto:flexcoders@yahoogroups.com Subject: Re: [flexcoders] Re: advanceddatagrid itemrenderer refering current column's data Hey Amy great getting an email from you. Man I guess you paid google : every time I search anything regarding ADG you blog pops up. :-) Thanks for taking time to share that with us. As I found all your examples are addressing the whole row, I needed something for individual cells. I tried to work with your code and put the itemrenderer in ADGColumn but did not work accordingly. My requirement is very simple: all my ADGColumn will have the same itemrenderer and if the Column source has a nonempty string it will put the background color else leave it as is. Regards On Mon, Jul 14, 2008 at 3:49 PM, Amy [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , hworke [EMAIL PROTECTED] wrote: Hi, in a advanceddatagrid I need to put same background color if the the cell value is not empty string. In the itemrenderer all I need to check is if the current column value is null or not. I know how to refer a value of the data object in the itemrenderer like: data.whateverParameter. But in this case I need to refer the current column value not a fixed parameter of the data object. How do I refer to the current column vale in the itemrenderer? If you implement IDropInListRenderer, you can get access to the DataGridListData properties. Also, AdvancedDataGrid supports a style function, that you can use from outside the ADG to set styles. For more on that http://flexdiary.blogspot.com/2008/06/musings-on- http://flexdiary.blogspot.com/2008/06/musings-on- advanceddatagrid-part-1.html HTH; Amy
[flexcoders] Re: advanceddatagrid itemrenderer refering current column's data
--- In flexcoders@yahoogroups.com, Vivian Richard [EMAIL PROTECTED] wrote: Hey Amy great getting an email from you. Man I guess you paid google : every time I search anything regarding ADG you blog pops up. :-) Thanks for taking time to share that with us. As I found all your examples are addressing the whole row, I needed something for individual cells. I tried to work with your code and put the itemrenderer in ADGColumn but did not work accordingly. My requirement is very simple: all my ADGColumn will have the same itemrenderer and if the Column source has a nonempty string it will put the background color else leave it as is. I actually didn't provide any examples, just talked about the general principles, unless you're talking about the posts that I linked to that didn't quite do what I wanted. The styleFunction will do whatever you tell it to, so you can very easily use that to style the columns based on the dataField that is a property of the object you get in the second parameter. So you could use something like this: private function styleMyRenderers(data:Object, col:AdvancedDataGridColumn){ if (data[col.dataField]=='foo'){ return {backgroundColor:0xFF};//red } return {backgroundColor:0x00FF00};//green } HTH; Amy
[flexcoders] Re: advanceddatagrid itemrenderer refering current column's data
--- In flexcoders@yahoogroups.com, Alex Harui [EMAIL PROTECTED] wrote: Has anyone tried the background item renderers from my blog in ADG? No, but I wound up subclassing from AdvancedDatagridGroupItemRenderer because the AdvancedDataGridItemRenderer couldn't be made to support alpha in the background but not the text. I suspect anyone wanting aplha transparency might have the same problem with the renderers on your site. Thanks; Amy
Re: [flexcoders] Re: advanceddatagrid itemrenderer refering current column's data
Tel me try Amy, I will let you know. Alex I checked most of your examples most likely have seen yours. I will try that one too an let you know my impression about it. On Mon, Jul 14, 2008 at 6:03 PM, Amy [EMAIL PROTECTED] wrote: --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Vivian Richard [EMAIL PROTECTED] wrote: Hey Amy great getting an email from you. Man I guess you paid google : every time I search anything regarding ADG you blog pops up. :-) Thanks for taking time to share that with us. As I found all your examples are addressing the whole row, I needed something for individual cells. I tried to work with your code and put the itemrenderer in ADGColumn but did not work accordingly. My requirement is very simple: all my ADGColumn will have the same itemrenderer and if the Column source has a nonempty string it will put the background color else leave it as is. I actually didn't provide any examples, just talked about the general principles, unless you're talking about the posts that I linked to that didn't quite do what I wanted. The styleFunction will do whatever you tell it to, so you can very easily use that to style the columns based on the dataField that is a property of the object you get in the second parameter. So you could use something like this: private function styleMyRenderers(data:Object, col:AdvancedDataGridColumn){ if (data[col.dataField]=='foo'){ return {backgroundColor:0xFF};//red } return {backgroundColor:0x00FF00};//green } HTH; Amy
Re: [flexcoders] Re: advanceddatagrid itemrenderer refering current column's data
Hey Alex could not find the background itemrenderer for ADG in your blog. Could you please send me the link? On Mon, Jul 14, 2008 at 6:09 PM, Vivian Richard [EMAIL PROTECTED] wrote: Tel me try Amy, I will let you know. Alex I checked most of your examples most likely have seen yours. I will try that one too an let you know my impression about it. On Mon, Jul 14, 2008 at 6:03 PM, Amy [EMAIL PROTECTED] wrote: --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Vivian Richard [EMAIL PROTECTED] wrote: Hey Amy great getting an email from you. Man I guess you paid google : every time I search anything regarding ADG you blog pops up. :-) Thanks for taking time to share that with us. As I found all your examples are addressing the whole row, I needed something for individual cells. I tried to work with your code and put the itemrenderer in ADGColumn but did not work accordingly. My requirement is very simple: all my ADGColumn will have the same itemrenderer and if the Column source has a nonempty string it will put the background color else leave it as is. I actually didn't provide any examples, just talked about the general principles, unless you're talking about the posts that I linked to that didn't quite do what I wanted. The styleFunction will do whatever you tell it to, so you can very easily use that to style the columns based on the dataField that is a property of the object you get in the second parameter. So you could use something like this: private function styleMyRenderers(data:Object, col:AdvancedDataGridColumn){ if (data[col.dataField]=='foo'){ return {backgroundColor:0xFF};//red } return {backgroundColor:0x00FF00};//green } HTH; Amy
[flexcoders] Re: AdvancedDataGrid rowCount
Bump :-) --- In flexcoders@yahoogroups.com, Amy [EMAIL PROTECTED] wrote: Hi, all; I open all the nodes on my ADG when it is created. I'd like to make sure there are enough rows to show all the items without scroll bars. If I bind rowCount to myADG.dataProvider.length, it gives me enough rows to show the _closed_ nodes. I also tried myADG.dataProvideropenNodes().length, but that wasn't anywhere close. Is there a simple way to do this, or do I have to write a function that goes through and counts? TIA; Amy
[flexcoders] Re: AdvancedDataGrid rowCount
--- In flexcoders@yahoogroups.com, Amy [EMAIL PROTECTED] wrote: Hi, all; I open all the nodes on my ADG when it is created. I'd like to make sure there are enough rows to show all the items without scroll bars. If I bind rowCount to myADG.dataProvider.length, it gives me enough rows to show the _closed_ nodes. I also tried myADG.dataProvideropenNodes().length, but that wasn't anywhere close. Is there a simple way to do this, or do I have to write a function that goes through and counts? It seems that the length DOES reflect the total number of nodes, but for some reason I was not able to bind directly to the length of the dataprovider. When I used a separate variable set to the length, it worked perfectly. Thanks all who helped ;-)
[flexcoders] Re: AdvancedDataGrid grouping with different depths
Anyone have an idea on this problem? Thanks in advance. --- In flexcoders@yahoogroups.com, rueter007 [EMAIL PROTECTED] wrote: Hi, I have the following dataprovider for an ADG. [Bindable] private var dpFlat:ArrayCollection = new ArrayCollection([ {Region:Southwest, State:Arizona, Title:Barbara Jennings, Actual:38865, Estimate:4}, {Region:Southwest, State:Arizona, Title:Dana Binn, Actual:29885, Estimate:3}, {Region:Southwest, State:Central California, Title:Joe Smith, Actual:29134, Estimate:3}, {Region:Southwest, State:Nevada, Title:Bethany Pittman, Actual:52888, Estimate:45000}, {Region:East, State:Northern California, Title:Lauren Ipsum, Actual:38805, Estimate:4}, {Region:East, State:Northern California, Title:T.R. Smith, Actual:55498, Estimate:4}, {Region:West, State:Southern California, Title:Alice Treu, Actual:44985, Estimate:45000}, {Region:West, State:Southern California, Title:Jane Grove, Actual:44913, Estimate:45000}, {State:Idaho, Title:Lauren Ipsum, Actual:38805, Estimate:4}, {Title:ABD PST, Actual:38805, Estimate:4} ]); I defined the grouping as follows. mx:dataProvider mx:GroupingCollection id=gc source={dpFlat} mx:grouping mx:Grouping mx:GroupingField name=Region mx:summaries mx:SummaryRow summaryPlacement=group mx:fields mx:SummaryField dataField=Actual operation=SUM/ mx:SummaryField dataField=Estimate operation=SUM/ /mx:fields /mx:SummaryRow /mx:summaries /mx:GroupingField mx:GroupingField name=State mx:summaries mx:SummaryRow summaryPlacement=group mx:fields mx:SummaryField dataField=Actual operation=SUM/ mx:SummaryField dataField=Estimate operation=SUM/ /mx:fields /mx:SummaryRow /mx:summaries /mx:GroupingField /mx:Grouping /mx:grouping /mx:GroupingCollection /mx:dataProvider The problem is with the last two rows in the dataprovider. ADG forces all of them to be at the same depth and adds 'Not Available' tree nodes instead of placing the rows without the open/close icons at the top level. Is it possible to disable grouping when not necessary? This is a common requirement and I believe there should be a way to get this working. thanks, venkat
[flexcoders] Re: AdvancedDataGrid scrolling
Hi, The only way to get smooth scrolling, with any of the list based components, is to place them in a container (like canvas) and set the list's height explicitly; to render all of the items (valueCommit=myList.height = myList.measureHeightOfItems). This will give you a performance hit, but the scroll will be more natural. This however, will negate the ability to scrollToIndex. -TH --- In flexcoders@yahoogroups.com, michal.sustr [EMAIL PROTECTED] wrote: Hi, is there a way how to enable AdvancedDataGrid scrolling not on rows, but on parts of rows? If some rows are too long (and others short), you can see jumping which is not very pleasant and is quite confusing. Sometimes it is even not possible to scroll down to last row.
Fwd: [flexcoders] Re: AdvancedDataGrid preserve openItems after data update
Hi, I did not fully understand how did how built objects or matched items. Could you be more explicit or could you show part of your code ? Thanks. --- In flexcoders@yahoogroups.com, jonese [EMAIL PROTECTED] wrote: OK here's what i did to keep my nodes open. un my update function i call preventDefault() to stop the expected operations. then i manually build using updated data my object instances then search the original objects till i find my matching object overwrite the orginial object with the new instance then run a refresh() on the dataprovider. This appears to be working for me and it is having the expected results.so far :) -- jonese http://www.jonese.us http://twitter.com/jonese
[flexcoders] Re: AdvancedDataGrid ItemRenderer
override updateDisplayList(..) function and set visibility there as opposed to in set data(...). --- In flexcoders@yahoogroups.com, securenetfreedom [EMAIL PROTECTED] wrote: I am using an ADG with HierarchicalData to group my data. I am using a checkbox item renderer that the user can check to archive the row. However, the checkbox is diplaying on every row and I need it to display only on the sub-set like below: Group | Archive | Title | Group1 --|-- chk --| Trains | --|-- chk --| Planes | Group2 --|-- chk --| Autos | I have tried setting the visibility of the Canvas (the base of the checkbox itemrenderer component) in the creationComplete handler and in the 'set data' method of the component which works on the first pass, but when scrolling the grid or expanding the nodes, results are inconsistent. private var _vis:Boolean; // called by creationComplete event public function init():void{ var nodeName:String = _listData[item].name(); _vis = (nodeName == item); this.visible = _vis; } override public function set data(value:Object):void { super.data = value; chkbox.selected = (value[_dataField] == true); this.visible = _vis; } Thanks for your input. Jeff
RE: [flexcoders] Re: AdvancedDataGrid ItemRenderer
And remove that logic from the creationComplete handler entirely. Do you understand why? Tracy From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of gene_belor Sent: Tuesday, June 10, 2008 10:58 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: AdvancedDataGrid ItemRenderer override updateDisplayList(..) function and set visibility there as opposed to in set data(...). --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , securenetfreedom [EMAIL PROTECTED] wrote: I am using an ADG with HierarchicalData to group my data. I am using a checkbox item renderer that the user can check to archive the row. However, the checkbox is diplaying on every row and I need it to display only on the sub-set like below: Group | Archive | Title | Group1 --|-- chk --| Trains | --|-- chk --| Planes | Group2 --|-- chk --| Autos | I have tried setting the visibility of the Canvas (the base of the checkbox itemrenderer component) in the creationComplete handler and in the 'set data' method of the component which works on the first pass, but when scrolling the grid or expanding the nodes, results are inconsistent. private var _vis:Boolean; // called by creationComplete event public function init():void{ var nodeName:String = _listData[item].name(); _vis = (nodeName == item); this.visible = _vis; } override public function set data(value:Object):void { super.data = value; chkbox.selected = (value[_dataField] == true); this.visible = _vis; } Thanks for your input. Jeff
[flexcoders] Re: AdvancedDataGrid ItemRenderer
Tracy, Is it because creationComplete only happens once per visible row and the renderer is recycled on dg scroll, change, etc? What I desperately want to learn is how to know when to override a super's function - in this case updateDisplayList(). How would you know to do that verses invalidateList() or invalidateDisplayList()?? Is this learned by experience (such as how I am right now), or does one look at this code and intuitively know to override updateDisplayList? Does it become more apparent when you start disecting inherited classes? How is this learned? BTW, your input helped me arrive at a very elegant solution with native mxml - AdvancedDataGridRendererProvider: mx:AdvancedDataGrid ... mx:columns mx:AdvancedDataGridColumn headerText=Archive dataField=@archived width=50 id=archived_col / mx:AdvancedDataGridColumn ... / /mx:columns mx:rendererProviders mx:AdvancedDataGridRendererProvider column={archiveed_col} depth=2 renderer=renderers.CheckBoxItemRendererProvider/ /mx:rendererProviders /mx:AdvancedDataGrid The depth is the key - where 1 would be the Group node and 2 would be the first indentation or sub-set of data under the grouping. Even though I found a solution, I am still very interested in your thoughts on the learning approach query above. Thanks to all, Jeff --- In flexcoders@yahoogroups.com, Tracy Spratt [EMAIL PROTECTED] wrote: And remove that logic from the creationComplete handler entirely. Do you understand why? Tracy From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of gene_belor Sent: Tuesday, June 10, 2008 10:58 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: AdvancedDataGrid ItemRenderer override updateDisplayList(..) function and set visibility there as opposed to in set data(...). --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , securenetfreedom nv1000@ wrote: I am using an ADG with HierarchicalData to group my data. I am using a checkbox item renderer that the user can check to archive the row. However, the checkbox is diplaying on every row and I need it to display only on the sub-set like below: Group | Archive | Title | Group1 --|-- chk --| Trains | --|-- chk --| Planes | Group2 --|-- chk --| Autos | I have tried setting the visibility of the Canvas (the base of the checkbox itemrenderer component) in the creationComplete handler and in the 'set data' method of the component which works on the first pass, but when scrolling the grid or expanding the nodes, results are inconsistent. private var _vis:Boolean; // called by creationComplete event public function init():void{ var nodeName:String = _listData[item].name(); _vis = (nodeName == item); this.visible = _vis; } override public function set data(value:Object):void { super.data = value; chkbox.selected = (value[_dataField] == true); this.visible = _vis; } Thanks for your input. Jeff
[flexcoders] Re: AdvancedDataGrid doesn't update with real data?
Hi, I try to fix this add change event like the following code.but I am nulucky.the problem still there.Please give a idea how to fix this. (ModelLocator.QModel is a Arraycollection) Thanks for your help. Mark ps:code mx:AdvancedDataGrid x=24 y=70 width=569 height=239 rowCount=4 initialize=gc1.refresh() show=gc1.refresh() change=gc1.refresh() mx:dataProvider mx:GroupingCollection id=gc1 source={ModelLocator.QModel} mx:grouping mx:Grouping mx:GroupingField name=TypeName / /mx:Grouping /mx:grouping /mx:GroupingCollection /mx:dataProvider mx:columns mx:AdvancedDataGridColumn headerText=Name dataField=Name/ mx:AdvancedDataGridColumn headerText=Department dataField=Department/ /mx:columns /mx:AdvancedDataGrid --- In flexcoders@yahoogroups.com, Gregor Kiddie [EMAIL PROTECTED] wrote: Your problem is that the GroupingCollection dataprovider doesn't dispatch change events for the underlying collection, so binding doesn't work. Either subclass GroupingCollection and dispatch the events yourself, or manually create a new GroupingCollection everytime the underlying collection changes and reset the ADGs dp. The bug is http://bugs.adobe.com/jira/browse/FLEXDMV-1334 http://bugs.adobe.com/jira/browse/FLEXDMV-1334 Gk. Gregor Kiddie Senior Developer INPS Tel: 01382 564343 Registered address: The Bread Factory, 1a Broughton Street, London SW8 3QJ Registered Number: 1788577 Registered in the UK Visit our Internet Web site at www.inps.co.uk blocked::http://www.inps.co.uk/ The information in this internet email is confidential and is intended solely for the addressee. Access, copying or re-use of information in it by anyone else is not authorised. Any views or opinions presented are solely those of the author and do not necessarily represent those of INPS or any of its affiliates. If you are not the intended recipient please contact [EMAIL PROTECTED] From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of markflex2007 Sent: 06 May 2008 18:17 To: flexcoders@yahoogroups.com Subject: [flexcoders] AdvancedDataGrid doesn't update with real data? Hi, I am working with cairngorm with Flex 3. I use Datagrid before in the page and it works fine.The Datagrid automatically update when the data updated in database. ... mx:DataGrid x=15 y=72 width=581.5 height=239 dataProvider={ModelLocator.QModel} mx:columns mx:DataGridColumn headerText=Name dataField=Name/ mx:DataGridColumn headerText=Department dataField=Department/ /mx:columns /mx:DataGrid ... I just use AdvancedDataGrid to raplace DataGrid and add grouping feature.But it has a problem now. mx:AdvancedDataGrid x=15 y=72 width=581.5 height=239 rowCount=4 initialize=gc1.refresh(); mx:dataProvider mx:GroupingCollection id=gc1 source={ModelLocator.QModel} mx:grouping mx:Grouping mx:GroupingField name=TypeName / /mx:Grouping /mx:grouping /mx:GroupingCollection /mx:dataProvider mx:columns mx:AdvancedDataGridColumn headerText=Name dataField=Name/ mx:AdvancedDataGridColumn headerText=Department dataField=Department/ /mx:columns /mx:AdvancedDataGrid The problem is the AdvancedDataGrid doesn't update even if data updated in database when I visit the page again. Please give me a idea how to fix this.why this happen Thanks for your help Mark
RE: [flexcoders] Re: AdvancedDataGrid doesn't update with real data?
I threw some code at you yesterday for subclassing the collection yesterday in your other thread about the ADG. Gk. Gregor Kiddie Senior Developer INPS Tel: 01382 564343 Registered address: The Bread Factory, 1a Broughton Street, London SW8 3QJ Registered Number: 1788577 Registered in the UK Visit our Internet Web site at www.inps.co.uk blocked::http://www.inps.co.uk/ The information in this internet email is confidential and is intended solely for the addressee. Access, copying or re-use of information in it by anyone else is not authorised. Any views or opinions presented are solely those of the author and do not necessarily represent those of INPS or any of its affiliates. If you are not the intended recipient please contact [EMAIL PROTECTED] From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of markflex2007 Sent: 07 May 2008 14:33 To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: AdvancedDataGrid doesn't update with real data? Hi, I try to fix this add change event like the following code.but I am nulucky.the problem still there.Please give a idea how to fix this. (ModelLocator.QModel is a Arraycollection) Thanks for your help. Mark ps:code mx:AdvancedDataGrid x=24 y=70 width=569 height=239 rowCount=4 initialize=gc1.refresh() show=gc1.refresh() change=gc1.refresh() mx:dataProvider mx:GroupingCollection id=gc1 source={ModelLocator.QModel} mx:grouping mx:Grouping mx:GroupingField name=TypeName / /mx:Grouping /mx:grouping /mx:GroupingCollection /mx:dataProvider mx:columns mx:AdvancedDataGridColumn headerText=Name dataField=Name/ mx:AdvancedDataGridColumn headerText=Department dataField=Department/ /mx:columns /mx:AdvancedDataGrid --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , Gregor Kiddie [EMAIL PROTECTED] wrote: Your problem is that the GroupingCollection dataprovider doesn't dispatch change events for the underlying collection, so binding doesn't work. Either subclass GroupingCollection and dispatch the events yourself, or manually create a new GroupingCollection everytime the underlying collection changes and reset the ADGs dp. The bug is http://bugs.adobe.com/jira/browse/FLEXDMV-1334 http://bugs.adobe.com/jira/browse/FLEXDMV-1334 http://bugs.adobe.com/jira/browse/FLEXDMV-1334 http://bugs.adobe.com/jira/browse/FLEXDMV-1334 Gk. Gregor Kiddie Senior Developer INPS Tel: 01382 564343 Registered address: The Bread Factory, 1a Broughton Street, London SW8 3QJ Registered Number: 1788577 Registered in the UK Visit our Internet Web site at www.inps.co.uk blocked::http://www.inps.co.uk/ http://www.inps.co.uk/ The information in this internet email is confidential and is intended solely for the addressee. Access, copying or re-use of information in it by anyone else is not authorised. Any views or opinions presented are solely those of the author and do not necessarily represent those of INPS or any of its affiliates. If you are not the intended recipient please contact [EMAIL PROTECTED] From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com [mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com ] On Behalf Of markflex2007 Sent: 06 May 2008 18:17 To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com Subject: [flexcoders] AdvancedDataGrid doesn't update with real data? Hi, I am working with cairngorm with Flex 3. I use Datagrid before in the page and it works fine.The Datagrid automatically update when the data updated in database. ... mx:DataGrid x=15 y=72 width=581.5 height=239 dataProvider={ModelLocator.QModel} mx:columns mx:DataGridColumn headerText=Name dataField=Name/ mx:DataGridColumn headerText=Department dataField=Department/ /mx:columns /mx:DataGrid ... I just use AdvancedDataGrid to raplace DataGrid and add grouping feature.But it has a problem now. mx:AdvancedDataGrid x=15 y=72 width=581.5 height=239 rowCount=4 initialize=gc1.refresh(); mx:dataProvider mx:GroupingCollection id=gc1 source={ModelLocator.QModel} mx:grouping mx:Grouping mx:GroupingField name=TypeName / /mx:Grouping /mx:grouping /mx:GroupingCollection /mx:dataProvider mx:columns mx:AdvancedDataGridColumn headerText=Name dataField=Name/ mx:AdvancedDataGridColumn headerText=Department dataField=Department/ /mx:columns /mx:AdvancedDataGrid The problem is the AdvancedDataGrid doesn't update even if data updated in database when I visit the page again. Please give me a idea how to fix this.why this happen Thanks for your help Mark
[flexcoders] Re: AdvancedDataGrid (focus?) problem
Kindly log a bug here - http://bugs.adobe.com/flex/ --- In flexcoders@yahoogroups.com, kummallinen_puu [EMAIL PROTECTED] wrote: I'm having some weird issues with ADG that seem to be somehow focus related. In some cases ADG will open editor for the last edited cell even though the editing has been stopped earlier. This can be reproduced in the example program (which can be found from the end of this message) by following these steps: 1. Open Southwest - Nevada. 2. Click Estimate column for the Bethany Pittman row to start editing. 3. Cancel edit by pressing ESC. 4. Select Northern California. 5. Select Submenu from Menu. What's happening here is that after clicking submenu, an editor will open for the cell that was edited in step 2 and that row becomes selected again. This seems to happen with Opera, Firefox and IE. There is also another similar issue that seems to exist only for Firefox and Opera: 1. Follow steps 1-4 from the previous example. 2. Change to some other program window. 3. Go back to the browser. 4. Click anywhere in the table. Again, editor for the last edited cell will open where ever you click. Is there something I'm missing here or is this a bug in ADG? ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute mx:Script ![CDATA[ import mx.collections.ArrayCollection; [Bindable] private var dpFlat:ArrayCollection = new ArrayCollection([ {Region:Southwest, Territory:Arizona, Territory_Rep:Barbara Jennings, Actual:38865, Estimate:4}, {Region:Southwest, Territory:Arizona, Territory_Rep:Dana Binn, Actual:29885, Estimate:3}, {Region:Southwest, Territory:Central California, Territory_Rep:Joe Smith, Actual:29134, Estimate:3}, {Region:Southwest, Territory:Nevada, Territory_Rep:Bethany Pittman, Actual:52888, Estimate:45000}, {Region:Southwest, Territory:Northern California, Territory_Rep:Lauren Ipsum, Actual:38805, Estimate:4}, {Region:Southwest, Territory:Northern California, Territory_Rep:T.R. Smith, Actual:55498, Estimate:4}, {Region:Southwest, Territory:Southern California, Territory_Rep:Alice Treu, Actual:44985, Estimate:45000}, {Region:Southwest, Territory:Southern California, Territory_Rep:Jane Grove, Actual:44913, Estimate:45000} ]); ]] /mx:Script mx:Panel title=AdvancedDataGrid Control Example height=75% width=75% layout=horizontal paddingTop=10 paddingBottom=10 paddingLeft=10 paddingRight=10 mx:MenuBar labelField=@label mx:XMLList menuitem label=Menu menuitem label=Submenu / /menuitem /mx:XMLList /mx:MenuBar mx:AdvancedDataGrid id=myADG width=100% height=100% editable=true initialize=gc.refresh(); mx:dataProvider mx:GroupingCollection id=gc source={dpFlat} mx:grouping mx:Grouping mx:GroupingField name=Region/ mx:GroupingField name=Territory/ /mx:Grouping /mx:grouping /mx:GroupingCollection /mx:dataProvider mx:columns mx:AdvancedDataGridColumn dataField=Region editable=false/ mx:AdvancedDataGridColumn dataField=Territory editable=false/ mx:AdvancedDataGridColumn dataField=Territory_Rep headerText=Territory Rep editable=false/ mx:AdvancedDataGridColumn dataField=Actual editable=false/ mx:AdvancedDataGridColumn dataField=Estimate editable=true/ /mx:columns /mx:AdvancedDataGrid /mx:Panel /mx:Application
Fwd: [flexcoders] Re: AdvancedDataGrid preserve openItems after data update
OK here's what i did to keep my nodes open. un my update function i call preventDefault() to stop the expected operations. then i manually build using updated data my object instances then search the original objects till i find my matching object overwrite the orginial object with the new instance then run a refresh() on the dataprovider. This appears to be working for me and it is having the expected results.so far :) -- jonese http://www.jonese.us http://twitter.com/jonese On Wed, Apr 23, 2008 at 9:27 PM, rockstar77877 [EMAIL PROTECTED] wrote: Scott and Jonese: I am currently trying to deal with the same issue. I was actually ALMOST there, but I think I have discovered a bug in Flex. So the problem: Keeping the AdvancedDataGrid nodes that were already expanded, open after a filter and refresh (specifically a 'GroupCollection' refresh). First, I got a nice array of objects containing the 'nodes' for the grid nodes that were opened, adg.dataProvider.openNodes Next, I did the filter and gc.refresh(). The final step was to iterate through all the nodes, find out which ones had the same GroupLabel, and expand them using adg.dataProvider.openNode(node:Object). This is where I ran into problems. When I tried to re-open a node using openNode, the node would expand, but the nodes below it would not be in the right tree level (it seems as if they were stepping down in level one by one, even though they were supposed to be all on the same level below it). Now here is a real kicker! If I go to click on anything in the grid after that, the display automatically corrects itself! So odd. If anyone has seen the same thing, or know what I'm even talking about please let me know. Thanks! rockstar --- In flexcoders@yahoogroups.com, Eric Jones [EMAIL PROTECTED] wrote: Did you ever figure out how to do this? jonese --- In flexcoders@yahoogroups.com, smelbyfastlane smelby@ wrote: Hello - I am using an AdvancedDataGrid to display data that is retrieved periodically from a HTTPService. When handling the result event I parse the lastResult e4x into typed objects and put them into an ArrayCollection which is the source for a GroupingCollection as laid out below. After doing all of this I call groupedData.refresh() to get my new data displayed. All of this works fine, except that after calling groupedData.refresh() my group nodes (in the grid) are all collapsed. I have tried saving workItemsGrid.openItems into a temp variable, then setting it back after calling refresh... but that does not work. I am guessing that this is due to the fact that my data provider has entirely different object instances than it had previously. But, I am open to the idea that I just did it incorrectly somehow. Based on my thought that I have different objects in the DP than I did before I figured I could just save off the value of GroupLabel for each openItem, call refresh(), then iterate over the group objects and call workItemsGrid.expandItem() for each that has a GroupLabel that was previously open. The problem with this approach is that I have not yet been able to figure out how to iterate over the groups. Any help in getting my previously open items to re-open is greatly appreciated. Thanks in advance Scott mx:AdvancedDataGrid id=workItemsGrid width=100% height=100% mx:dataProvider mx:GroupingCollection id=groupedData source={flatWorkItemsAC} mx:Grouping ... /mx:Grouping /mx:GroupingCollection /mx:dataProvider ... /mx:AdvancedDataGrid
[flexcoders] Re: AdvancedDataGrid preserve openItems after data update
Can you post a sample in which the issues occurs? - Sameer --- In flexcoders@yahoogroups.com, rockstar77877 [EMAIL PROTECTED] wrote: Scott and Jonese: I am currently trying to deal with the same issue. I was actually ALMOST there, but I think I have discovered a bug in Flex. So the problem: Keeping the AdvancedDataGrid nodes that were already expanded, open after a filter and refresh (specifically a 'GroupCollection' refresh). First, I got a nice array of objects containing the 'nodes' for the grid nodes that were opened, adg.dataProvider.openNodes Next, I did the filter and gc.refresh(). The final step was to iterate through all the nodes, find out which ones had the same GroupLabel, and expand them using adg.dataProvider.openNode(node:Object). This is where I ran into problems. When I tried to re-open a node using openNode, the node would expand, but the nodes below it would not be in the right tree level (it seems as if they were stepping down in level one by one, even though they were supposed to be all on the same level below it). Now here is a real kicker! If I go to click on anything in the grid after that, the display automatically corrects itself! So odd. If anyone has seen the same thing, or know what I'm even talking about please let me know. Thanks! rockstar --- In flexcoders@yahoogroups.com, Eric Jones gigado@ wrote: Did you ever figure out how to do this? jonese --- In flexcoders@yahoogroups.com, smelbyfastlane smelby@ wrote: Hello - I am using an AdvancedDataGrid to display data that is retrieved periodically from a HTTPService. When handling the result event I parse the lastResult e4x into typed objects and put them into an ArrayCollection which is the source for a GroupingCollection as laid out below. After doing all of this I call groupedData.refresh() to get my new data displayed. All of this works fine, except that after calling groupedData.refresh() my group nodes (in the grid) are all collapsed. I have tried saving workItemsGrid.openItems into a temp variable, then setting it back after calling refresh... but that does not work. I am guessing that this is due to the fact that my data provider has entirely different object instances than it had previously. But, I am open to the idea that I just did it incorrectly somehow. Based on my thought that I have different objects in the DP than I did before I figured I could just save off the value of GroupLabel for each openItem, call refresh(), then iterate over the group objects and call workItemsGrid.expandItem() for each that has a GroupLabel that was previously open. The problem with this approach is that I have not yet been able to figure out how to iterate over the groups. Any help in getting my previously open items to re-open is greatly appreciated. Thanks in advance Scott mx:AdvancedDataGrid id=workItemsGrid width=100% height=100% mx:dataProvider mx:GroupingCollection id=groupedData source={flatWorkItemsAC} mx:Grouping ... /mx:Grouping /mx:GroupingCollection /mx:dataProvider ... /mx:AdvancedDataGrid
[flexcoders] Re: AdvancedDataGrid preserve openItems after data update
Scott and Jonese: I am currently trying to deal with the same issue. I was actually ALMOST there, but I think I have discovered a bug in Flex. So the problem: Keeping the AdvancedDataGrid nodes that were already expanded, open after a filter and refresh (specifically a 'GroupCollection' refresh). First, I got a nice array of objects containing the 'nodes' for the grid nodes that were opened, adg.dataProvider.openNodes Next, I did the filter and gc.refresh(). The final step was to iterate through all the nodes, find out which ones had the same GroupLabel, and expand them using adg.dataProvider.openNode(node:Object). This is where I ran into problems. When I tried to re-open a node using openNode, the node would expand, but the nodes below it would not be in the right tree level (it seems as if they were stepping down in level one by one, even though they were supposed to be all on the same level below it). Now here is a real kicker! If I go to click on anything in the grid after that, the display automatically corrects itself! So odd. If anyone has seen the same thing, or know what I'm even talking about please let me know. Thanks! rockstar --- In flexcoders@yahoogroups.com, Eric Jones [EMAIL PROTECTED] wrote: Did you ever figure out how to do this? jonese --- In flexcoders@yahoogroups.com, smelbyfastlane smelby@ wrote: Hello - I am using an AdvancedDataGrid to display data that is retrieved periodically from a HTTPService. When handling the result event I parse the lastResult e4x into typed objects and put them into an ArrayCollection which is the source for a GroupingCollection as laid out below. After doing all of this I call groupedData.refresh() to get my new data displayed. All of this works fine, except that after calling groupedData.refresh() my group nodes (in the grid) are all collapsed. I have tried saving workItemsGrid.openItems into a temp variable, then setting it back after calling refresh... but that does not work. I am guessing that this is due to the fact that my data provider has entirely different object instances than it had previously. But, I am open to the idea that I just did it incorrectly somehow. Based on my thought that I have different objects in the DP than I did before I figured I could just save off the value of GroupLabel for each openItem, call refresh(), then iterate over the group objects and call workItemsGrid.expandItem() for each that has a GroupLabel that was previously open. The problem with this approach is that I have not yet been able to figure out how to iterate over the groups. Any help in getting my previously open items to re-open is greatly appreciated. Thanks in advance Scott mx:AdvancedDataGrid id=workItemsGrid width=100% height=100% mx:dataProvider mx:GroupingCollection id=groupedData source={flatWorkItemsAC} mx:Grouping ... /mx:Grouping /mx:GroupingCollection /mx:dataProvider ... /mx:AdvancedDataGrid
[flexcoders] Re: AdvancedDataGrid preserve openItems after data update
Did you ever figure out how to do this? jonese --- In flexcoders@yahoogroups.com, smelbyfastlane [EMAIL PROTECTED] wrote: Hello - I am using an AdvancedDataGrid to display data that is retrieved periodically from a HTTPService. When handling the result event I parse the lastResult e4x into typed objects and put them into an ArrayCollection which is the source for a GroupingCollection as laid out below. After doing all of this I call groupedData.refresh() to get my new data displayed. All of this works fine, except that after calling groupedData.refresh() my group nodes (in the grid) are all collapsed. I have tried saving workItemsGrid.openItems into a temp variable, then setting it back after calling refresh... but that does not work. I am guessing that this is due to the fact that my data provider has entirely different object instances than it had previously. But, I am open to the idea that I just did it incorrectly somehow. Based on my thought that I have different objects in the DP than I did before I figured I could just save off the value of GroupLabel for each openItem, call refresh(), then iterate over the group objects and call workItemsGrid.expandItem() for each that has a GroupLabel that was previously open. The problem with this approach is that I have not yet been able to figure out how to iterate over the groups. Any help in getting my previously open items to re-open is greatly appreciated. Thanks in advance Scott mx:AdvancedDataGrid id=workItemsGrid width=100% height=100% mx:dataProvider mx:GroupingCollection id=groupedData source={flatWorkItemsAC} mx:Grouping ... /mx:Grouping /mx:GroupingCollection /mx:dataProvider ... /mx:AdvancedDataGrid
[flexcoders] Re: AdvancedDataGrid group filtering openNode
Adnan or Nigel, Did either of you resolve this? Any change you could post a solution? jonese --- In flexcoders@yahoogroups.com, nigelrmtaylor [EMAIL PROTECTED] wrote: Adnan Did you get any further with this? It looks like I'm trying to solve the same problem as you. Cheers Nigel --- In flexcoders@yahoogroups.com, Adnan Doric astronaute@ wrote: Hello guys, I'm trying to filter my ADG without success : I created a GroupingCollection from a flat ArrayCollection. ADG's dataProvider is GroupingCollection. First issue : refresh if I filter the underlaying ArrayCollection, the related groupingCollection doesn't refresh automatically (bug? feature?) Actually I menaged to force gc.refresh() with some event( it is impossible to listen on CollectionEventKind.REFRESH because of infinite loop ac.refresh = gc.refresh ) Second issue (more important) : openNodes Ok now that my gc is refreshed, the Tree in the ADG collapses itself (ok let say that is normal), and I need it to expand all nodes that were opened before. I tried to do something like this : var openNodes : Object = IHierarchicalCollectionView( myADG.dataProvider ).openNodes; gc.refresh(); myADG.dataProvider.openNodes = openNodes; and it doesn't works. next I tried this : var openNodes : Object = IHierarchicalCollectionView( myADG.dataProvider ).openNodes; for each( var node : Object in openNodes ) { IHierarchicalCollectionView( myADG.dataProvider.openNode( node ) } guess what, doesn't work :) I'm calling myADG.invalidateList() each time too. I don't know what to do to achieve this simple task, I'm a bit disappointed because I expected lot more from the brand new AdvancedDataGrid and this basic functionality actually seems too hard to implement. I still hope I'm wrong and someone can show me the correct solution :) Thank you all, Adnan
[flexcoders] Re: AdvancedDataGrid - Changing the background color on a row.
Hi, I just need to set the Background color of the First Row to a specific color and the rest of the rows can have the default background. And the data for the grid is set using the dataProvider ( ArrayCollection) is set at runtime. So i don't want this Item Renderer for each and every row. Is there a simple way to do this.. I couldn't find a method to check the columnNumber from the passed AdvancedDataGridColumn Object !!! I have this method to set the style as per sreeni code.. private function setRowStyle(data:Object, col:AdvancedDataGridColumn):Object{ // I need to check if the column is 0 and it has a specific value..(To determine this is the first row..) if (col.){ return { rowColor:0xFF, fontWeight:bold }; } return {}; } Thanks Mars --- In flexcoders@yahoogroups.com, Cato Paus [EMAIL PROTECTED] wrote: Also take a look at this http://weblogs.macromedia.com/pent/archives/2007/02/index.cfm Cato --- In flexcoders@yahoogroups.com, Dominic Pazula dompazz@ wrote: Awesome! Thanks. I had put this on the back burner and was working on the lower hanging fruit for my project. --- In flexcoders@yahoogroups.com, sreeni_r sreeni_r@ wrote: I have posted a working sample here which I think you can tweak it work your scenario. http://flexpearls.blogspot.com/2008/02/row-background-color- in.html -Sreenivas --- In flexcoders@yahoogroups.com, Dominic Pazula dompazz@ wrote: I thought this would be easy to do, but I have been banging my head on it for a while. I'm wanting to let the user mark rows as they scroll through the ADG. I created a function myRowStyle and set styleFunction=myRowStyle. What I cannot figure out is how to change the background color on the row. I've figured out how to change just about everything else. Here is the myRowStyle function. I am just setting a static set of rows to the style to help me figure this out. private function myRowStyle(data:Object, col:AdvancedDataGridColumn):Object{ var vals:Array = [0, 2, 4, 6]; var i:int = dg.dataProvider.getItemIndex(data); if (vals.indexOf(i) = 0){ var o:Object = new Object; o.color = 0x00; o.fontWeight = bold; o.backgroundColor = 0xFF; return o; } else return null; } o.backgroundColor is just my latest attempt. I've tried everything I can think of, but obviously have not thought of everything. Does anyone know the trick to doing this? Thanks Dominic
[flexcoders] Re: AdvancedDataGrid group filtering openNode
Adnan Did you get any further with this? It looks like I'm trying to solve the same problem as you. Cheers Nigel --- In flexcoders@yahoogroups.com, Adnan Doric [EMAIL PROTECTED] wrote: Hello guys, I'm trying to filter my ADG without success : I created a GroupingCollection from a flat ArrayCollection. ADG's dataProvider is GroupingCollection. First issue : refresh if I filter the underlaying ArrayCollection, the related groupingCollection doesn't refresh automatically (bug? feature?) Actually I menaged to force gc.refresh() with some event( it is impossible to listen on CollectionEventKind.REFRESH because of infinite loop ac.refresh = gc.refresh ) Second issue (more important) : openNodes Ok now that my gc is refreshed, the Tree in the ADG collapses itself (ok let say that is normal), and I need it to expand all nodes that were opened before. I tried to do something like this : var openNodes : Object = IHierarchicalCollectionView( myADG.dataProvider ).openNodes; gc.refresh(); myADG.dataProvider.openNodes = openNodes; and it doesn't works. next I tried this : var openNodes : Object = IHierarchicalCollectionView( myADG.dataProvider ).openNodes; for each( var node : Object in openNodes ) { IHierarchicalCollectionView( myADG.dataProvider.openNode( node ) } guess what, doesn't work :) I'm calling myADG.invalidateList() each time too. I don't know what to do to achieve this simple task, I'm a bit disappointed because I expected lot more from the brand new AdvancedDataGrid and this basic functionality actually seems too hard to implement. I still hope I'm wrong and someone can show me the correct solution :) Thank you all, Adnan
[flexcoders] Re: AdvancedDataGrid - selecting a cell
In fact, it is even simplier. The grid comes with an empty record. Moving a mouse over second column I have noticed that a mouse pointer will change to mouse arrow from the middle of the column while moving to the right. And it will be staying like this over second column as well. Moving mouse to the left over being second column will change mouse pointer into the vertical. --- In flexcoders@yahoogroups.com, markgoldin_2000 [EMAIL PROTECTED] wrote: I am having a problem with ADG. It has 3 columns. I am dynamically adding records to it when a user moves a cursor from a cell down. I see that when I move a mouse over third column in some records (at least in one in my testing) the row does not change its border and the cell does not accept the cursor after I click on it. Doing some manipulations with mouse and keyboard will eventually position the cursor in that cell. Any idea what's going on? I am using trial version of Flex 3. Thanks
Re: [flexcoders] Re: AdvancedDataGrid - Changing the background color on a row.
Oh, I fully understand why it's a problem with how they've decided to implement it. I'm just saying they might rethink on how they want to implement it if the outcome is that they're missing a feature that's pretty standard on every other grid component out there. Who knows, maybe in Flex 4... On Thu, Feb 21, 2008 at 8:20 PM, sreeni_r [EMAIL PROTECTED] wrote: I think it is the problem with itemRenderers or TextField in particular. If a itemRenderer doesn't support backgroundColor as a style there is very little ADG can do. Hence a small tweak is required to get this working. As TextField doesn't support alpha when background is true some users don't like this idea and go on to override the drawRowBackground. --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Pan Troglodytes [EMAIL PROTECTED] wrote: I am fairly shocked that AdvancedDataGrid does not support this out of the box. They went to a lot of trouble to make styling a single cell easy, yet left out one of the most important parts. Hope this is added before release. On Thu, Feb 21, 2008 at 12:33 AM, sreeni_r [EMAIL PROTECTED] wrote: I have posted a working sample here which I think you can tweak it work your scenario. http://flexpearls.blogspot.com/2008/02/row-background-color- in.html -Sreenivas --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.comflexcoders% 40yahoogroups.com, Dominic Pazula dompazz@ wrote: I thought this would be easy to do, but I have been banging my head on it for a while. I'm wanting to let the user mark rows as they scroll through the ADG. I created a function myRowStyle and set styleFunction=myRowStyle. What I cannot figure out is how to change the background color on the row. I've figured out how to change just about everything else. Here is the myRowStyle function. I am just setting a static set of rows to the style to help me figure this out. private function myRowStyle(data:Object, col:AdvancedDataGridColumn):Object{ var vals:Array = [0, 2, 4, 6]; var i:int = dg.dataProvider.getItemIndex(data); if (vals.indexOf(i) = 0){ var o:Object = new Object; o.color = 0x00; o.fontWeight = bold; o.backgroundColor = 0xFF; return o; } else return null; } o.backgroundColor is just my latest attempt. I've tried everything I can think of, but obviously have not thought of everything. Does anyone know the trick to doing this? Thanks Dominic -- Jason -- Jason
Re: [flexcoders] Re: AdvancedDataGrid - Changing the background color on a row.
I am fairly shocked that AdvancedDataGrid does not support this out of the box. They went to a lot of trouble to make styling a single cell easy, yet left out one of the most important parts. Hope this is added before release. On Thu, Feb 21, 2008 at 12:33 AM, sreeni_r [EMAIL PROTECTED] wrote: I have posted a working sample here which I think you can tweak it work your scenario. http://flexpearls.blogspot.com/2008/02/row-background-color-in.html -Sreenivas --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Dominic Pazula [EMAIL PROTECTED] wrote: I thought this would be easy to do, but I have been banging my head on it for a while. I'm wanting to let the user mark rows as they scroll through the ADG. I created a function myRowStyle and set styleFunction=myRowStyle. What I cannot figure out is how to change the background color on the row. I've figured out how to change just about everything else. Here is the myRowStyle function. I am just setting a static set of rows to the style to help me figure this out. private function myRowStyle(data:Object, col:AdvancedDataGridColumn):Object{ var vals:Array = [0, 2, 4, 6]; var i:int = dg.dataProvider.getItemIndex(data); if (vals.indexOf(i) = 0){ var o:Object = new Object; o.color = 0x00; o.fontWeight = bold; o.backgroundColor = 0xFF; return o; } else return null; } o.backgroundColor is just my latest attempt. I've tried everything I can think of, but obviously have not thought of everything. Does anyone know the trick to doing this? Thanks Dominic -- Jason
[flexcoders] Re: AdvancedDataGrid - Changing the background color on a row.
Awesome! Thanks. I had put this on the back burner and was working on the lower hanging fruit for my project. --- In flexcoders@yahoogroups.com, sreeni_r [EMAIL PROTECTED] wrote: I have posted a working sample here which I think you can tweak it work your scenario. http://flexpearls.blogspot.com/2008/02/row-background-color-in.html -Sreenivas --- In flexcoders@yahoogroups.com, Dominic Pazula dompazz@ wrote: I thought this would be easy to do, but I have been banging my head on it for a while. I'm wanting to let the user mark rows as they scroll through the ADG. I created a function myRowStyle and set styleFunction=myRowStyle. What I cannot figure out is how to change the background color on the row. I've figured out how to change just about everything else. Here is the myRowStyle function. I am just setting a static set of rows to the style to help me figure this out. private function myRowStyle(data:Object, col:AdvancedDataGridColumn):Object{ var vals:Array = [0, 2, 4, 6]; var i:int = dg.dataProvider.getItemIndex(data); if (vals.indexOf(i) = 0){ var o:Object = new Object; o.color = 0x00; o.fontWeight = bold; o.backgroundColor = 0xFF; return o; } else return null; } o.backgroundColor is just my latest attempt. I've tried everything I can think of, but obviously have not thought of everything. Does anyone know the trick to doing this? Thanks Dominic
[flexcoders] Re: AdvancedDataGrid - Changing the background color on a row.
Also take a look at this http://weblogs.macromedia.com/pent/archives/2007/02/index.cfm Cato --- In flexcoders@yahoogroups.com, Dominic Pazula [EMAIL PROTECTED] wrote: Awesome! Thanks. I had put this on the back burner and was working on the lower hanging fruit for my project. --- In flexcoders@yahoogroups.com, sreeni_r sreeni_r@ wrote: I have posted a working sample here which I think you can tweak it work your scenario. http://flexpearls.blogspot.com/2008/02/row-background-color- in.html -Sreenivas --- In flexcoders@yahoogroups.com, Dominic Pazula dompazz@ wrote: I thought this would be easy to do, but I have been banging my head on it for a while. I'm wanting to let the user mark rows as they scroll through the ADG. I created a function myRowStyle and set styleFunction=myRowStyle. What I cannot figure out is how to change the background color on the row. I've figured out how to change just about everything else. Here is the myRowStyle function. I am just setting a static set of rows to the style to help me figure this out. private function myRowStyle(data:Object, col:AdvancedDataGridColumn):Object{ var vals:Array = [0, 2, 4, 6]; var i:int = dg.dataProvider.getItemIndex(data); if (vals.indexOf(i) = 0){ var o:Object = new Object; o.color = 0x00; o.fontWeight = bold; o.backgroundColor = 0xFF; return o; } else return null; } o.backgroundColor is just my latest attempt. I've tried everything I can think of, but obviously have not thought of everything. Does anyone know the trick to doing this? Thanks Dominic
[flexcoders] Re: AdvancedDataGrid - Changing the background color on a row.
I think it is the problem with itemRenderers or TextField in particular. If a itemRenderer doesn't support backgroundColor as a style there is very little ADG can do. Hence a small tweak is required to get this working. As TextField doesn't support alpha when background is true some users don't like this idea and go on to override the drawRowBackground. --- In flexcoders@yahoogroups.com, Pan Troglodytes [EMAIL PROTECTED] wrote: I am fairly shocked that AdvancedDataGrid does not support this out of the box. They went to a lot of trouble to make styling a single cell easy, yet left out one of the most important parts. Hope this is added before release. On Thu, Feb 21, 2008 at 12:33 AM, sreeni_r [EMAIL PROTECTED] wrote: I have posted a working sample here which I think you can tweak it work your scenario. http://flexpearls.blogspot.com/2008/02/row-background-color- in.html -Sreenivas --- In flexcoders@yahoogroups.com flexcoders% 40yahoogroups.com, Dominic Pazula dompazz@ wrote: I thought this would be easy to do, but I have been banging my head on it for a while. I'm wanting to let the user mark rows as they scroll through the ADG. I created a function myRowStyle and set styleFunction=myRowStyle. What I cannot figure out is how to change the background color on the row. I've figured out how to change just about everything else. Here is the myRowStyle function. I am just setting a static set of rows to the style to help me figure this out. private function myRowStyle(data:Object, col:AdvancedDataGridColumn):Object{ var vals:Array = [0, 2, 4, 6]; var i:int = dg.dataProvider.getItemIndex(data); if (vals.indexOf(i) = 0){ var o:Object = new Object; o.color = 0x00; o.fontWeight = bold; o.backgroundColor = 0xFF; return o; } else return null; } o.backgroundColor is just my latest attempt. I've tried everything I can think of, but obviously have not thought of everything. Does anyone know the trick to doing this? Thanks Dominic -- Jason
[flexcoders] Re: AdvancedDataGrid - Changing the background color on a row.
I have posted a working sample here which I think you can tweak it work your scenario. http://flexpearls.blogspot.com/2008/02/row-background-color-in.html -Sreenivas --- In flexcoders@yahoogroups.com, Dominic Pazula [EMAIL PROTECTED] wrote: I thought this would be easy to do, but I have been banging my head on it for a while. I'm wanting to let the user mark rows as they scroll through the ADG. I created a function myRowStyle and set styleFunction=myRowStyle. What I cannot figure out is how to change the background color on the row. I've figured out how to change just about everything else. Here is the myRowStyle function. I am just setting a static set of rows to the style to help me figure this out. private function myRowStyle(data:Object, col:AdvancedDataGridColumn):Object{ var vals:Array = [0, 2, 4, 6]; var i:int = dg.dataProvider.getItemIndex(data); if (vals.indexOf(i) = 0){ var o:Object = new Object; o.color = 0x00; o.fontWeight = bold; o.backgroundColor = 0xFF; return o; } else return null; } o.backgroundColor is just my latest attempt. I've tried everything I can think of, but obviously have not thought of everything. Does anyone know the trick to doing this? Thanks Dominic
Re: [flexcoders] Re: AdvancedDataGrid ItemRenderer
You can find out what row they are dragging over using the information in the DragEvent... here is a snippet that may help. It is modified from my original code, but should get you most of the way home :) If there is an easier way to find the item i'd sure like to know... public function handleDragOver(event:DragEvent):void { var dropTargetItem:Object = null; var dropTarget:AdvancedDataGrid=AdvancedDataGrid(event.currentTarget); var dropIndex:int = dropTarget.calculateDropIndex(event); // Get drop target. var view:ICollectionView = ICollectionView(loadOutsGrid.dataProvider); if(dropIndex view.length) { var cursor:IViewCursor = view.createCursor(); var x:int = 0; while(cursor.afterLast == false x dropIndex) { cursor.moveNext(); x++; } if(cursor.afterLast == false) { dropTargetItem = cursor.current; } } } hth Scott Scott Melby Founder, Fast Lane Software LLC http://www.fastlanesw.com loc_tran106 wrote: Scott, But for my application, i need to determine the target more so than the initiator. By specifying the event listener on the datagrid, i lose the ability to determine which row the user is specifying... Or am I wrong? Tnx, -L
[flexcoders] Re: AdvancedDataGrid ItemRenderer
Scott, But for my application, i need to determine the target more so than the initiator. By specifying the event listener on the datagrid, i lose the ability to determine which row the user is specifying... Or am I wrong? Tnx, -L
[flexcoders] Re: AdvancedDataGrid ItemRenderer
Scott, Thank you very much! I would never have figured that one out! Thanks for your help, it works wonderfully now. -Loc
[flexcoders] Re: AdvancedDataGrid - Changing the background color on a row.
Many thanks! --- In flexcoders@yahoogroups.com, Sherif Abdou [EMAIL PROTECTED] wrote: http://www.mikenimer.com/index.cfm/2006/10/3/BackgroundRowColor- DataGrid-component - Original Message From: Dominic Pazula [EMAIL PROTECTED] To: flexcoders@yahoogroups.com Sent: Tuesday, February 12, 2008 7:08:20 AM Subject: [flexcoders] AdvancedDataGrid - Changing the background color on a row. I thought this would be easy to do, but I have been banging my head on it for a while. I'm wanting to let the user mark rows as they scroll through the ADG. I created a function myRowStyle and set styleFunction= myRowStyle . What I cannot figure out is how to change the background color on the row. I've figured out how to change just about everything else. Here is the myRowStyle function. I am just setting a static set of rows to the style to help me figure this out. private function myRowStyle(data: Object, col:AdvancedDataGri dColumn): Object{ var vals:Array = [0, 2, 4, 6]; var i:int = dg.dataProvider. getItemIndex( data); if (vals.indexOf( i) = 0){ var o:Object = new Object; o.color = 0x00; o.fontWeight = bold; o.backgroundColor = 0xFF; return o; } else return null; } o.backgroundColor is just my latest attempt. I've tried everything I can think of, but obviously have not thought of everything. Does anyone know the trick to doing this? Thanks Dominic __ __ Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
RE: [flexcoders] Re: AdvancedDataGrid Keyboard navigation to objects within components
I renamed the subject to get the attention of the folks who wrote this component. They should be at work by now. From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Dominic Pazula Sent: Monday, February 11, 2008 5:58 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Keyboard navigation to objects within components Hi Alex, If it were only that simple... As I said earlier, the change event is not fired (in the ADG) when a user arrows off the header. If I am tracing the movement of the selected cell around the ADG, I miss a cell when the user arrows up too far, i.e. to the header, and then arrows down. Give the case below to see what I mean (xml file at http://www.talonrisk.com/apps/test/data.xml http://www.talonrisk.com/apps/test/data.xml ). Should the change event be fired here? Is this a bug? If not, is there an event that IS fired in this case? Thanks Dominic ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml http://www.adobe.com/2006/mxml layout=absolute mx:Script ![CDATA[ import mx.events.ScrollEvent; import mx.collections.ArrayCollection; import mx.rpc.events.ResultEvent; import mx.events.ListEvent; private var sRow:int; private var sCol:int; private function selectCell(event:ListEvent):void{ sCol = event.columnIndex; sRow = event.rowIndex; sRowText.text = Selected Row: + sRow.toString(); sColText.text = Selected Column: +sCol.toString(); } private function resHandler(event:ResultEvent):void{ dg.dataProvider = event.result.TABLE.X; } ]] /mx:Script mx:HTTPService url=data.xml result=resHandler(event) id=data/ mx:VBox height=100% width=100% creationComplete=data.send() mx:HBox width=100% mx:Text id=sColText/ mx:Text id=sRowText/ /mx:HBox mx:AdvancedDataGrid id=dg height=100% width=100% itemClick=selectCell(event) change=selectCell(event) selectionMode=singleCell mx:columns mx:AdvancedDataGridColumn dataField=date / mx:AdvancedDataGridColumn dataField=char / mx:AdvancedDataGridColumn dataField=num / /mx:columns /mx:AdvancedDataGrid /mx:VBox /mx:Application --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , Alex Harui [EMAIL PROTECTED] wrote: I'm confused as to why you want focus on those renderers if you can't edit them. If focus doesn't matter, the scroll and change events should be firing as you arrow around. From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com [mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com ] On Behalf Of Dominic Pazula Sent: Monday, February 11, 2008 9:57 AM To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com Subject: [flexcoders] Re: Keyboard navigation to objects within components I'm looking to: I have an AdvancedDataGrid and I want track the user paging up, down, and across the grid with the arrow keys. I don't want the data to be editable, which means I cannot use the itemFocusIn event (throw, as you say, by the item editor). So I would like to know when the user scrolls through a datagrid (preferably an ADG) using the arrow keys. I do NOT want the data to be editable. The itemFocusIn event does not fire, and the change event does not produce acceptable results. I think the answer to the question, is No this is NOT possible out of the box. You have to write a renderer that implements IFocusManager and use the itemFocusIn event Thanks Dominic --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com mailto:flexcoders% 40yahoogroups.com , Alex Harui aharui@ wrote: I'm not clear what you want. You want arrow keys and pageup/dn to navigate to various cells and then edit those cells?
[flexcoders] Re: AdvancedDataGrid - how to clear contents?
Hi Greg, Thanks for the reply! I've figured out the way how to clear the contents. I was unable to do it if ADG and group collection and dataprovider were in MXML format. So, I just created independent ArrayCollection, binded it to the GroupCollection as source and then after getting query result from server manually inserted objects from HTTPService into the ArrayCollection. And before fetching the data simply call arrayCollection.removeAll(); After debugging the code I would say that the you can't clear the contents assigning null to the data provider as code checks everywhere if source != null and in this case just doing nothing. O the contrary, if you generate CollectionChanged event everything is fine. PS I am still wondering how direct binding HttpService ADG works for most of the people - for example when result is just only one object XML parser does not generate vector representation of data. Anyhow, I am avoiding MXML as much as possible. Cheers, Dmitri. --- In flexcoders@yahoogroups.com, Mr Greg Murnock [EMAIL PROTECTED] wrote: Are you sure there isn't another datProvider set somewhere? I use ADG.dataProvider = null to clear datagrids out in a couple different areas and have never had a problem. also make sure you aren't reasigning the original DP somewhere. Greg
[flexcoders] Re: AdvancedDataGrid sortable column headers
By setting ADG.sortExpertMode to true you can get rid of the separator. I don't think there is any easy way of getting rid of the number other than using a custom sort item renderer. --- In flexcoders@yahoogroups.com, Scott Melby [EMAIL PROTECTED] wrote: Can anybody tell me how to make the sortable column headers on an AdvancedDataGrid look like the headers on a regular DataGrid? All I want is the header text and the sort direction arrow. I'd rather not have the separator and sort number. Thanks Scott -- Scott Melby Founder, Fast Lane Software LLC http://www.fastlanesw.com
[flexcoders] Re: AdvancedDataGrid::toolTip formatting
If you need groupLabelFunction or the normal labelFunction to show html text you need to use custom itemRenderers because the default itemRenderes do not attempt to show html text. --- In flexcoders@yahoogroups.com, tungchau81 [EMAIL PROTECTED] wrote: The same thing for groupLabelFunction. Returned HTML text is not accepted. --- In flexcoders@yahoogroups.com, sreeni_r sreeni_r@ wrote: Hi Tung, you can use the trick mentioned here http://www.flex-flex.net/blog/article.asp?id=18 to display html formatted strings as toolTips. -Sreenivas --- In flexcoders@yahoogroups.com, tungchau81 tungchau81@ wrote: Hi, I wrote my own custom dataTipFunction that return an HTML formatted text, but it does not work. Please help! private function myDataTip(data:Object):String { return BTung Chau/B; } The result I saw was a raw BTung Chau/B instead of the bold text format I want. Please help. Tung Chau
Re: [flexcoders] Re: AdvancedDataGrid::toolTip formatting
I just wrote this post http://blog.fastlanesw.com/?p=31 on my blog this morning that shows how to do HTML tooltips in Flex. It is very simple. hth Scott tungchau81 wrote: The full code is : private function myDataTip(data:Object):String { return BTung Chau/B; } controls:AdvancedDataGrid id=reportTable groupIconFunction=reportArchiveGroupingIcon defaultLeafIcon={Icons.ReportArchiveIcon} dataTipFunction=myDataTip initialize=gc.refresh(); width=100% height=100% controls:columns mx:AdvancedDataGridColumn id=nameCol dataField=name headerText={getString('label.reportName')} showDataTips=true minWidth=300/ mx:AdvancedDataGridColumn id=sDateCol dataField=startDate labelFunction=formatStartDate headerText={getString ('label.reportStartDate')} showDataTips=true width=100/ mx:AdvancedDataGridColumn id=eDateCol dataField=endDate labelFunction=formatEndDate headerText={getString ('label.reportEndDate')} showDataTips=true width=100/ mx:AdvancedDataGridColumn id=createdOnCol dataField=createdOn labelFunction=formatCreatedOnDate headerText={getString ('label.createdOn')} showDataTips=true width=100/ /controls:columns /controls:AdvancedDataGrid Please help. --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com, tungchau81 [EMAIL PROTECTED] wrote: Hi, I wrote my own custom dataTipFunction that return an HTML formatted text, but it does not work. Please help! private function myDataTip(data:Object):String { return BTung Chau/B; } The result I saw was a raw BTung Chau/B instead of the bold text format I want. Please help. Tung Chau
[flexcoders] Re: AdvancedDataGrid::toolTip formatting
The full code is : private function myDataTip(data:Object):String { return BTung Chau/B; } controls:AdvancedDataGrid id=reportTable groupIconFunction=reportArchiveGroupingIcon defaultLeafIcon={Icons.ReportArchiveIcon} dataTipFunction=myDataTip initialize=gc.refresh(); width=100% height=100% controls:columns mx:AdvancedDataGridColumn id=nameCol dataField=name headerText={getString('label.reportName')} showDataTips=true minWidth=300/ mx:AdvancedDataGridColumn id=sDateCol dataField=startDate labelFunction=formatStartDate headerText={getString ('label.reportStartDate')} showDataTips=true width=100/ mx:AdvancedDataGridColumn id=eDateCol dataField=endDate labelFunction=formatEndDate headerText={getString ('label.reportEndDate')} showDataTips=true width=100/ mx:AdvancedDataGridColumn id=createdOnCol dataField=createdOn labelFunction=formatCreatedOnDate headerText={getString ('label.createdOn')} showDataTips=true width=100/ /controls:columns /controls:AdvancedDataGrid Please help. --- In flexcoders@yahoogroups.com, tungchau81 [EMAIL PROTECTED] wrote: Hi, I wrote my own custom dataTipFunction that return an HTML formatted text, but it does not work. Please help! private function myDataTip(data:Object):String { return BTung Chau/B; } The result I saw was a raw BTung Chau/B instead of the bold text format I want. Please help. Tung Chau
[flexcoders] Re: AdvancedDataGrid::toolTip formatting
Thanks alot for your suggestion. I will check it out. Regards, Tung Chau. --- In flexcoders@yahoogroups.com, tungchau81 [EMAIL PROTECTED] wrote: The full code is : private function myDataTip(data:Object):String { return BTung Chau/B; } controls:AdvancedDataGrid id=reportTable groupIconFunction=reportArchiveGroupingIcon defaultLeafIcon={Icons.ReportArchiveIcon} dataTipFunction=myDataTip initialize=gc.refresh(); width=100% height=100% controls:columns mx:AdvancedDataGridColumn id=nameCol dataField=name headerText={getString('label.reportName')} showDataTips=true minWidth=300/ mx:AdvancedDataGridColumn id=sDateCol dataField=startDate labelFunction=formatStartDate headerText={getString ('label.reportStartDate')} showDataTips=true width=100/ mx:AdvancedDataGridColumn id=eDateCol dataField=endDate labelFunction=formatEndDate headerText={getString ('label.reportEndDate')} showDataTips=true width=100/ mx:AdvancedDataGridColumn id=createdOnCol dataField=createdOn labelFunction=formatCreatedOnDate headerText={getString ('label.createdOn')} showDataTips=true width=100/ /controls:columns /controls:AdvancedDataGrid Please help. --- In flexcoders@yahoogroups.com, tungchau81 tungchau81@ wrote: Hi, I wrote my own custom dataTipFunction that return an HTML formatted text, but it does not work. Please help! private function myDataTip(data:Object):String { return BTung Chau/B; } The result I saw was a raw BTung Chau/B instead of the bold text format I want. Please help. Tung Chau
[flexcoders] Re: AdvancedDataGrid::toolTip formatting
The same thing for groupLabelFunction. Returned HTML text is not accepted. --- In flexcoders@yahoogroups.com, sreeni_r [EMAIL PROTECTED] wrote: Hi Tung, you can use the trick mentioned here http://www.flex-flex.net/blog/article.asp?id=18 to display html formatted strings as toolTips. -Sreenivas --- In flexcoders@yahoogroups.com, tungchau81 tungchau81@ wrote: Hi, I wrote my own custom dataTipFunction that return an HTML formatted text, but it does not work. Please help! private function myDataTip(data:Object):String { return BTung Chau/B; } The result I saw was a raw BTung Chau/B instead of the bold text format I want. Please help. Tung Chau
[flexcoders] Re: advancedDataGrid drag over column calculating wrong index
If you drop the item with the mouse over the top half of the first item it becomes the first item. If you move the mouse over the column header it becomes the last item. It is the same behavior even with simple List. I don't know whether it is a very expected behavior or not ! --- In flexcoders@yahoogroups.com, Seth Caldwell [EMAIL PROTECTED] wrote: Sorry, column header* From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Seth Caldwell Sent: Friday, November 16, 2007 11:31 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] advancedDataGrid drag over column calculating wrong index If I drag an element over a column of a datagrid, I would expect the index to be the first in the list, or not accept the drag. The default behavior at the moment is if you are dragging and releasing over the column, you are 'dropping' at the last index in the list. is this expected behavior for anyone? Seth
[flexcoders] Re: advancedDataGrid drag over column calculating wrong index
If you drop the item with the mouse over the top half of the first item it becomes the first item. If you move the mouse over the column header it becomes the last item. It is the same behavior even with simple List. I don't know whether it is a very expected behavior or not ! --- In flexcoders@yahoogroups.com, Seth Caldwell [EMAIL PROTECTED] wrote: Sorry, column header* From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Seth Caldwell Sent: Friday, November 16, 2007 11:31 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] advancedDataGrid drag over column calculating wrong index If I drag an element over a column of a datagrid, I would expect the index to be the first in the list, or not accept the drag. The default behavior at the moment is if you are dragging and releasing over the column, you are 'dropping' at the last index in the list. is this expected behavior for anyone? Seth
[flexcoders] Re: AdvancedDataGrid and setItemAt()
Thanks! getItemIndex works not indexOf. But still I have one problem. i have ADG and arraycollection where all data is. Arraycollection have ordernumber, orderline, product etc. data. And i have grouped lines by ordernumber. If i edit line it moves to last. Is there possible to sort data by ordernumber and after that by orderline -number? of course if user click header sorting change, but at default it sort by ordernumber, orderline. Thanks for helping! --- In flexcoders@yahoogroups.com, Paul Dale [EMAIL PROTECTED] wrote: The selectedIndex is the index of the row in the visual object, which might not be the same as the index of the item in the data provider. You can use data.setItemAt(adg.selectedItem,data.indexOf(adg.selectedItem)).
Re: [flexcoders] Re: AdvancedDataGrid and setItemAt()
You need to set the ArrayCollection.sort property... have a look at mx.collections.Sort and mx.collections.SortField. There are examples on this page http://livedocs.adobe.com/flex/2/langref/mx/collections/Sort.html that show how you can create a Sort with multiple SortFields. hth Scott Scott Melby Founder, Fast Lane Software LLC http://www.fastlanesw.com monkeeeh wrote: Thanks! getItemIndex works not indexOf. But still I have one problem. i have ADG and arraycollection where all data is. Arraycollection have ordernumber, orderline, product etc. data. And i have grouped lines by ordernumber. If i edit line it moves to last. Is there possible to sort data by ordernumber and after that by orderline -number? of course if user click header sorting change, but at default it sort by ordernumber, orderline. Thanks for helping! --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com, Paul Dale [EMAIL PROTECTED] wrote: The selectedIndex is the index of the row in the visual object, which might not be the same as the index of the item in the data provider. You can use data.setItemAt(adg.selectedItem,data.indexOf(adg.selectedItem)).
[flexcoders] Re: AdvancedDataGrid and setItemAt()
With normal DataGrid setItemAt this works.