I don't use ADG all that much, but the filter functions should get a
"record" node for each call of the filter function.  Have you used
toXMLString() to trace out the item?  Inside the filter function you can use
any e4x expressions to traverse the xml, down into the child nodes or even
up to parent nodes.

 

I am pretty sure you are not getting the entire dataProvider in the
function.  Do the trace.

 

Tracy Spratt,

Lariat Services, development services available

  _____  

From: [email protected] [mailto:[email protected]] On
Behalf Of chigwell23
Sent: Thursday, August 27, 2009 4:25 AM
To: [email protected]
Subject: [flexcoders] Re: Apply filterFunction to datagrid XMLListCollection
dataprovider question

 

  

I wonder if is even possible to use the filter function with hierarchical
XML, as all of the examples I have seen are of array collections or flat
XML?

This I think is the problem - the complete data provider is being passed
into the item parameter of the filter i.e. the xml hierarchy in its
entirety. I am presuming that the filter wants one "row" at a time so it can
do its compare. Where do I have control of this? I am not sure I do since
the only code is

lstRepRankDrill.filterFunction = filterRepRankDtlChnl;

The data provider is

dataProvider="{lstRepRankDrill[0].record}" in order to dig into the XML
hierarchy to get to the data. (Wrapper nodes are returned by SQL back end. 

--- In flexcod...@yahoogro <mailto:flexcoders%40yahoogroups.com> ups.com,
"Tracy Spratt" <tr...@...> wrote:
>
> Break the code into smaller pieces and debug to see what is wrong.
> 
> 
> 
> 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 chigwell23
> Sent: Thursday, August 27, 2009 2:40 AM
> To: flexcod...@yahoogro <mailto:flexcoders%40yahoogroups.com> ups.com
> Subject: [flexcoders] Apply filterFunction to datagrid XMLListCollection
> dataprovider question
> 
> 
> 
> 
> 
> private function filterRepRankDtlChnl(item:Object):Boolean{
> if(item.results.record.chnl_cd == "PREM") return true;
> else return false; 
> }
> 
> Filter is not filtering and I think it maybe item.results.record.chnl_cd -
> the item:Object is in this format:
> 
> item
> ...<results>
> ......<record>
> .........<chnl_cd>
> .........<rep_nm> etc
> 
> What is the correct "path" for chnl_cd and might this be the problem? TIA,
> 
> Mic.
>



Reply via email to