[flexcoders] questionfor AdvancedDataGrid?

2008-05-06 Thread markflex2007
Hi,

I have the following question about AdvancedDataGrid?

The code works fine:(code 1)

?xml version=1.0 encoding=utf-8?
mx:Application xmlns:mx=http://www.adobe.com/2006/mxml;
backgroundColor=#32669D
xmlns:ext=nl.wv.extenders.panel.*
  width=854
   
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 id=panel04 title=test panel
x=255 y=100 width=575 height=342
layout=absolute  
mx:Label x=15
y=46 text= Requests in the queue:
width=152 f/
   
 
 
mx:AdvancedDataGrid id=myADG  x=36 y=72
initialize=gc.refresh(); width=520 height=218
mx:dataProvider
mx:GroupingCollection id=gc source={dpFlat}
mx:grouping
mx:Grouping
 
mx:GroupingField name=Territory/
/mx:Grouping
/mx:grouping
/mx:GroupingCollection
/mx:dataProvider

mx:columns
mx:AdvancedDataGridColumn dataField=Region/
mx:AdvancedDataGridColumn dataField=Territory/
mx:AdvancedDataGridColumn dataField=Territory_Rep
headerText=Territory Rep/

/mx:columns
/mx:AdvancedDataGrid   
   
   
/mx:Panel   

   
/mx:Application

---

This code doesn't work (code 2)

?xml version=1.0 encoding=utf-8?
mx:Application xmlns:mx=http://www.adobe.com/2006/mxml;
backgroundColor=#32669D
xmlns:ext=nl.wv.extenders.panel.*
creati  show=QueueRequest()  width=854
   
mx:Script
![CDATA[   

import mx.collections.ArrayCollection; 
 
   
[Bindable]
public var dpFlat:ArrayCollection ; 
   
   
private function QueueRequest():void{
   
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 id=panel04 title=test panel
x=255 y=100 width=575 

AW: [flexcoders] questionfor AdvancedDataGrid?

2008-05-06 Thread Andreas Santoro
you have a local Variable in your function


private function QueueRequest():void{

var dpFlat:ArrayCollection = new ArrayCollection([
{Region:Southwest, Territory:Arizona,
Territory_Rep:Barbara Jennings, Actual:38865,

CHANGE TO

private function QueueRequest():void{

dpFlat= new ArrayCollection([
{Region:Southwest, Territory:Arizona,
Territory_Rep:Barbara Jennings, Actual:38865,



Andreas Santoro
Senior Consultant


Plan-B GmbH
Kolpingstr. 6
D-73433 Aalen

Tel.: +49 (0) 177 1762129
Mail: [EMAIL PROTECTED]mailto:[EMAIL PROTECTED]-b-gmbh.commailto:[EMAIL 
PROTECTED]
Web: 
www.planhttp://www.plan-b-gmbh.com/-b-gmbh.comhttp://www.plan-b-gmbh.com/

Geschäftsführer
Tobias Schmailzl
Ralph Sturm
Registergericht Ulm
HRB 720355
Sitz der Gesellschaft ist Aalen
Ust.ID DE250875731

Von: flexcoders@yahoogroups.com [EMAIL PROTECTED] im Auftrag von markflex2007 
[EMAIL PROTECTED]
Gesendet: Dienstag, 6. Mai 2008 15:55
An: flexcoders@yahoogroups.com
Betreff: [flexcoders] questionfor AdvancedDataGrid?


Hi,

I have the following question about AdvancedDataGrid?

The code works fine:(code 1)

?xml version=1.0 encoding=utf-8?
mx:Application xmlns:mx=http://www.adobe.com/2006/mxml;
backgroundColor=#32669D
xmlns:ext=nl.wv.extenders.panel.*
width=854

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 id=panel04 title=test panel
x=255 y=100 width=575 height=342
layout=absolute 
mx:Label x=15
y=46 text= Requests in the queue:
width=152 f/



mx:AdvancedDataGrid id=myADG x=36 y=72
initialize=gc.refresh(); width=520 height=218
mx:dataProvider
mx:GroupingCollection id=gc source={dpFlat}
mx:grouping
mx:Grouping

mx:GroupingField name=Territory/
/mx:Grouping
/mx:grouping
/mx:GroupingCollection
/mx:dataProvider

mx:columns
mx:AdvancedDataGridColumn dataField=Region/
mx:AdvancedDataGridColumn dataField=Territory/
mx:AdvancedDataGridColumn dataField=Territory_Rep
headerText=Territory Rep/

/mx:columns
/mx:AdvancedDataGrid


/mx:Panel

/mx:Application

--

This code doesn't work (code 2)

?xml version=1.0 encoding=utf-8?
mx:Application xmlns:mx=http://www.adobe.com/2006/mxml;
backgroundColor=#32669D
xmlns:ext=nl.wv.extenders.panel.*
creati show=QueueRequest() width=854

mx:Script
![CDATA[

import mx.collections.ArrayCollection;


[Bindable]
public var dpFlat:ArrayCollection ;


private function QueueRequest():void{

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 id=panel04 title=test panel
x=255 y=100 width=575 height=342
layout=absolute 
mx:Label x=15
y=46 text= Requests in the queue:
width=152 f/



mx:AdvancedDataGrid id=myADG x=36 y=72
initialize=gc.refresh(); width=520 height=218
mx:dataProvider
mx:GroupingCollection id=gc source={dpFlat}
mx:grouping
mx:Grouping

mx:GroupingField name=Territory/
/mx:Grouping
/mx:grouping
/mx:GroupingCollection
/mx:dataProvider

mx:columns
mx:AdvancedDataGridColumn dataField=Region/
mx:AdvancedDataGridColumn dataField=Territory/
mx:AdvancedDataGridColumn dataField=Territory_Rep
headerText=Territory Rep/

/mx:columns
/mx:AdvancedDataGrid


/mx:Panel

/mx:Application
--

The different between

RE: [flexcoders] questionfor AdvancedDataGrid?

2008-05-06 Thread Gregor Kiddie
I have the following question about AdvancedDataGrid?

Yeah, there is a closed bug about it (can't find the number just now!)

The Grouping and Hierarchical dataproviders don't throw events when
their contents change, so the binding never fires with what you have
there.

The workaround is to subclass the GroupingCollection and manually throw
the event when it changes.

 

I'll try and find the bug number...

 

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 14:55
To: flexcoders@yahoogroups.com
Subject: [flexcoders] questionfor AdvancedDataGrid?

 

Hi,

I have the following question about AdvancedDataGrid?






RE: [flexcoders] questionfor AdvancedDataGrid?

2008-05-06 Thread Gregor Kiddie
Found it ;) http://bugs.adobe.com/jira/browse/FLEXDMV-1334

 

I think the code below should work (untested and rough but you get the
idea)

 

package com.inpses.util {

  

  import flash.events.Event;

  

  import mx.collections.HierarchicalData;

  import mx.events.CollectionEvent;

  import mx.events.CollectionEventKind;

 

  public class EventHierarchicalDataSource extends HierarchicalData
{



public function
EventHierarchicalDataSource(value:Object=null) {

  super(value);

}



public override function set source( value : Object ) : void
{

  super.source = value;

  dispatchEvent( new CollectionEvent(
CollectionEvent.COLLECTION_CHANGE, false, false,
CollectionEventKind.REFRESH ) );

  if ( value ) {

value.addEventListener(
CollectionEvent.COLLECTION_CHANGE, dispatchSourceChangeEvent, false, 0,
true);

  }

}



private function dispatchSourceChangeEvent ( event : Event )
: void {

  dispatchEvent( new CollectionEvent(
CollectionEvent.COLLECTION_CHANGE, false, false,
CollectionEventKind.REFRESH ) );

}



  }

}

 

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 Gregor Kiddie
Sent: 06 May 2008 15:58
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] questionfor AdvancedDataGrid?

 

I have the following question about AdvancedDataGrid?

Yeah, there is a closed bug about it (can't find the number just now!)

The Grouping and Hierarchical dataproviders don't throw events when
their contents change, so the binding never fires with what you have
there.

The workaround is to subclass the GroupingCollection and manually throw
the event when it changes.

 

I'll try and find the bug number...

 

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 14:55
To: flexcoders@yahoogroups.com
Subject: [flexcoders] questionfor AdvancedDataGrid?

 

Hi,

I have the following question about AdvancedDataGrid?