RE: [flexcoders] Re: Multiple dataProviders for 1 dataGrid??

2005-04-29 Thread Jesus Salvador Ramos Cardona










Just a thought:



A while ago someone
posted a workaround to cell-freezing (like MSExcel). You could use that
approach to face such problem without having to combine WS results. Just place
one grid in one side of the other, and set their containers margins to 0, in order for them to
appear that both grids are part of one whole. That way you reduce overhead, and
stick to a modular approach.



Best regards.



J.











De: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] En nombre de Dave
Enviado el: Viernes, 29 de Abril
de 2005 08:10 am
Para: flexcoders@yahoogroups.com
Asunto: [flexcoders] Re: Multiple
dataProviders for 1 dataGrid??
Importancia: Alta





Tracy,

Thanks for your help. Now I have to add other
fields from other 
dataproviders but I think I can handle it.

I know this is probably AS 101, but how do I
create an object in the 
new array that is a product of a math function
between 2 other 
objects in the new array? 

Example: I need to create a column in the datagrid
called GROWTH 
that is simply the difference between TOTALBAL for
today and 
TOTALBAL for yesterday (TODAY - YESTERDAY).
Everything I try results 
in NaN.


Thanks for your patience.

-Dave

--- In flexcoders@yahoogroups.com,
Tracy Spratt [EMAIL PROTECTED] 
wrote:
 The example is attached, along with the
sample xml files I created 
to
 test it.
 
 Your array exists at
result.diffgram.PulseLoansToday. In the 
example I
 left the diffgram node out of my test xml.
 
 Basically, you assign the today and yesterday
arrays to variables,
 iterate through the today items, get the
matching yesterday item, 
build
 a combined item object, and add it to the
combined dataProvider 
array,
 which is bound to the DataGrid DataProvider.
 
 Tracy 
 
 -Original Message-
 From: flexcoders@yahoogroups.com

[mailto:flexcoders@yahoogroups.com]
On
 Behalf Of Dave
 Sent: Thursday, April 28, 2005 6:24 PM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] Re: Multiple
dataProviders for 1 dataGrid??
 
 OK. Let me backup. Below is a sample of the
data returned (an 
array 
 of objects?) from the WS with the date
specified as 1/10/2005. The 
 dataProvider for the datagrid 
 
is {service1.PulseLoansToday.result.diffgram.PulseLoansToday.PulseLo
 ansToday}
 
 Binding to the dataProvider as specified
produces the desired 
 results within the datagrid (using
CATEGORY, TOTALBAL, etc. as 
 the column names). 
 
 Here's the rub; within the SAME datagrid, I
need to display one 
 column of TOTALBAL for the selected
date(1/10/2005 in this case), 
 and another column of TOTALBAL for
yesterday's date (thisDate 
 request is empty so default is previous day's
date). Since I can 
 only bind a datagrid to one dataProvider, I
need a way to combine 
 the results into a new dataProvider that I
can bind to the 
datagrid.
 
 Thanks for your help,
 
 -Dave
 
 SAMPLE DATA RETURNED FROM WEB SERVICE
 ?xml version=1.0 encoding=UTF-8?
 soap:Envelope xmlns:xsd=http://www.w3.org/2001/XMLSchema

 xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance

 xmlns:soap=http://schemas.xmlsoap.org/soap/envelope/
 soap:Body

PulseLoansTodayResponse xmlns=http://srv-corp-
 sql/XmlWebServices/

PulseLoansTodayResult

xs:schema xmlns:msdata=urn:schemas-microsoft-com:xml-
 msdata xmlns:xs=http://www.w3.org/2001/XMLSchema
xmlns= 
 id=PulseLoansToday

xs:element name=PulseLoansToday 
 msdata:IsDataSet=true

xs:complexType

xs:choice maxOccurs=unbounded

xs:element name=PulseLoansToday

xs:complexType

xs:sequence

xs:element name=SCHEDDATE 
 type=xs:string
minOccurs=0/

xs:element name=CATEGORY 
 type=xs:string
minOccurs=0/

xs:element name=TOTALBAL 
 type=xs:decimal
minOccurs=0/

xs:element name=TOTALCNT 
 type=xs:decimal
minOccurs=0/

xs:element name=SORTBY 
 type=xs:int
minOccurs=0/

/xs:sequence

/xs:complexType

/xs:element

/xs:choice

/xs:complexType

/xs:element

/xs:schema

diffgr:diffgram xmlns:diffgr=urn:schemas-microsoft-
 com:xml-diffgram-v1
xmlns:msdata=urn:schemas-microsoft-com:xml-
 msdata

PulseLoansToday xmlns=

PulseLoansToday diffgr:id=PulseLoansToday1 
 msdata:rowOrder=0

SCHEDDATE01/10/2005/SCHEDDATE

CATEGORY1-NEW VEHICLE/CATEGORY

TOTALBAL61427820.1900/TOTALBAL

TOTALCNT3177/TOTALCNT

SORTBY1/SORTBY

/PulseLoansToday

PulseLoansToday diffgr:id=PulseLoansToday2 
 msdata:rowOrder=1

SCHEDDATE01/10/2005/SCHEDDATE

CATEGORY2-USED VEHICLE/CATEGORY

TOTALBAL51179669.7000/TOTALBAL

TOTALCNT4322/TOTALCNT

SORTBY2/SORTBY

/PulseLoansToday

PulseLoansToday diffgr:id=PulseLoansToday3 
 msdata:rowOrder=2

SCHEDDATE01/10/2005/SCHEDDATE

CATEGORY3-UNSECURED/CATEGORY

TOTALBAL997362.0700/TOTALBAL

TOTALCNT761/TOTALCNT

SORTBY3/SORTBY

/PulseLoansToday

PulseLoansToday diffgr:id=PulseLoansToday4 
 msdata:rowOrder=3

SCHEDDATE01/10/2005/SCHEDDATE

CATEGORY4-EQUITY MORTGAGES/CATEGORY

TOTALBAL11356456.8100/TOTALBAL

TOTALCNT545/TOTALCNT

SORTBY4/SORTBY

/PulseLoansToday

PulseLoansToday diffgr:id=PulseLoansToday5 
 msdata:rowOrder=4

SCHEDDATE01/10/2005/SCHEDDATE

RE: [flexcoders] Re: Multiple dataProviders for 1 dataGrid??

2005-04-28 Thread Tracy Spratt
The example is attached, along with the sample xml files I created to
test it.

Your array exists at result.diffgram.PulseLoansToday. In the example I
left the diffgram node out of my test xml.

Basically, you assign the today and yesterday arrays to variables,
iterate through the today items, get the matching yesterday item, build
a combined item object, and add it to the combined dataProvider array,
which is bound to the DataGrid DataProvider.

Tracy 

-Original Message-
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Dave
Sent: Thursday, April 28, 2005 6:24 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Multiple dataProviders for 1 dataGrid??

OK. Let me backup. Below is a sample of the data returned (an array 
of objects?) from the WS with the date specified as 1/10/2005. The 
dataProvider for the datagrid 
is {service1.PulseLoansToday.result.diffgram.PulseLoansToday.PulseLo
ansToday}

Binding to the dataProvider as specified produces the desired 
results within the datagrid (using CATEGORY, TOTALBAL, etc. as 
the column names). 

Here's the rub; within the SAME datagrid, I need to display one 
column of TOTALBAL for the selected date(1/10/2005 in this case), 
and another column of TOTALBAL for yesterday's date (thisDate 
request is empty so default is previous day's date). Since I can 
only bind a datagrid to one dataProvider, I need a way to combine 
the results into a new dataProvider that I can bind to the datagrid.

Thanks for your help,

-Dave

SAMPLE DATA RETURNED FROM WEB SERVICE
?xml version=1.0 encoding=UTF-8?
soap:Envelope xmlns:xsd=http://www.w3.org/2001/XMLSchema; 
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; 
xmlns:soap=http://schemas.xmlsoap.org/soap/envelope/;
   soap:Body
  PulseLoansTodayResponse xmlns=http://srv-corp-
sql/XmlWebServices/
 PulseLoansTodayResult
xs:schema xmlns:msdata=urn:schemas-microsoft-com:xml-
msdata xmlns:xs=http://www.w3.org/2001/XMLSchema; xmlns= 
id=PulseLoansToday
   xs:element name=PulseLoansToday 
msdata:IsDataSet=true;
  xs:complexType
 xs:choice maxOccurs=unbounded
xs:element name=PulseLoansToday
   xs:complexType
  xs:sequence
 xs:element name=SCHEDDATE 
type=xs:string minOccurs=0/
 xs:element name=CATEGORY 
type=xs:string minOccurs=0/
 xs:element name=TOTALBAL 
type=xs:decimal minOccurs=0/
 xs:element name=TOTALCNT 
type=xs:decimal minOccurs=0/
 xs:element name=SORTBY 
type=xs:int minOccurs=0/
  /xs:sequence
   /xs:complexType
/xs:element
 /xs:choice
  /xs:complexType
   /xs:element
/xs:schema
diffgr:diffgram xmlns:diffgr=urn:schemas-microsoft-
com:xml-diffgram-v1 xmlns:msdata=urn:schemas-microsoft-com:xml-
msdata
   PulseLoansToday xmlns=
  PulseLoansToday diffgr:id=PulseLoansToday1 
msdata:rowOrder=0;
 SCHEDDATE01/10/2005/SCHEDDATE
 CATEGORY1-NEW VEHICLE/CATEGORY
 TOTALBAL61427820.1900/TOTALBAL
 TOTALCNT3177/TOTALCNT
 SORTBY1/SORTBY
  /PulseLoansToday
  PulseLoansToday diffgr:id=PulseLoansToday2 
msdata:rowOrder=1;
 SCHEDDATE01/10/2005/SCHEDDATE
 CATEGORY2-USED VEHICLE/CATEGORY
 TOTALBAL51179669.7000/TOTALBAL
 TOTALCNT4322/TOTALCNT
 SORTBY2/SORTBY
  /PulseLoansToday
  PulseLoansToday diffgr:id=PulseLoansToday3 
msdata:rowOrder=2;
 SCHEDDATE01/10/2005/SCHEDDATE
 CATEGORY3-UNSECURED/CATEGORY
 TOTALBAL997362.0700/TOTALBAL
 TOTALCNT761/TOTALCNT
 SORTBY3/SORTBY
  /PulseLoansToday
  PulseLoansToday diffgr:id=PulseLoansToday4 
msdata:rowOrder=3;
 SCHEDDATE01/10/2005/SCHEDDATE
 CATEGORY4-EQUITY MORTGAGES/CATEGORY
 TOTALBAL11356456.8100/TOTALBAL
 TOTALCNT545/TOTALCNT
 SORTBY4/SORTBY
  /PulseLoansToday
  PulseLoansToday diffgr:id=PulseLoansToday5 
msdata:rowOrder=4;
 SCHEDDATE01/10/2005/SCHEDDATE
 CATEGORY5-HELOC FIXED/CATEGORY
 TOTALBAL2665131.6800/TOTALBAL
 TOTALCNT94/TOTALCNT
 SORTBY5/SORTBY
  /PulseLoansToday
  PulseLoansToday diffgr:id=PulseLoansToday6 
msdata:rowOrder=5

RE: [flexcoders] Re: Multiple dataProviders for 1 dataGrid??

2005-04-28 Thread Jesus Salvador Ramos Cardona










Would it not be better
and cleaner to modify the WS so you have all the data needed in one and only
one message?



Best regards.



J.











De:
flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] En nombre de Dave
Enviado el: Jueves, 28 de Abril de
2005 05:24 pm
Para: flexcoders@yahoogroups.com
Asunto: [flexcoders] Re: Multiple
dataProviders for 1 dataGrid??
Importancia: Alta





OK. Let me backup. Below is a sample of the data returned (an array 
of objects?) from the WS with the date specified
as 1/10/2005. The 
dataProvider for the datagrid 
is
{service1.PulseLoansToday.result.diffgram.PulseLoansToday.PulseLo
ansToday}

Binding to the dataProvider as specified produces
the desired 
results within the datagrid (using
CATEGORY, TOTALBAL, etc. as 
the column names). 

Here's the rub; within the SAME datagrid, I need
to display one 
column of TOTALBAL for the selected date(1/10/2005
in this case), 
and another column of TOTALBAL for yesterday's
date (thisDate 
request is empty so default is previous day's
date). Since I can 
only bind a datagrid to one dataProvider, I need a
way to combine 
the results into a new dataProvider that I can
bind to the datagrid.

Thanks for your help,

-Dave

SAMPLE DATA RETURNED FROM WEB SERVICE
?xml version=1.0
encoding=UTF-8?
soap:Envelope xmlns:xsd=http://www.w3.org/2001/XMLSchema

xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance

xmlns:soap=http://schemas.xmlsoap.org/soap/envelope/
 soap:Body

PulseLoansTodayResponse xmlns=http://srv-corp-
sql/XmlWebServices/

PulseLoansTodayResult

xs:schema xmlns:msdata=urn:schemas-microsoft-com:xml-
msdata xmlns:xs=http://www.w3.org/2001/XMLSchema
xmlns= 
id=PulseLoansToday

xs:element name=PulseLoansToday 
msdata:IsDataSet=true

xs:complexType

xs:choice maxOccurs=unbounded

xs:element name=PulseLoansToday

xs:complexType

xs:sequence

xs:element name=SCHEDDATE 
type=xs:string
minOccurs=0/

xs:element name=CATEGORY 
type=xs:string
minOccurs=0/

xs:element name=TOTALBAL 
type=xs:decimal
minOccurs=0/

xs:element name=TOTALCNT 
type=xs:decimal minOccurs=0/

xs:element name=SORTBY 
type=xs:int
minOccurs=0/

/xs:sequence

/xs:complexType

/xs:element

/xs:choice

/xs:complexType

/xs:element

/xs:schema

diffgr:diffgram xmlns:diffgr=urn:schemas-microsoft-
com:xml-diffgram-v1
xmlns:msdata=urn:schemas-microsoft-com:xml-
msdata

PulseLoansToday xmlns=

PulseLoansToday diffgr:id=PulseLoansToday1 
msdata:rowOrder=0

SCHEDDATE01/10/2005/SCHEDDATE

CATEGORY1-NEW VEHICLE/CATEGORY

TOTALBAL61427820.1900/TOTALBAL

TOTALCNT3177/TOTALCNT

SORTBY1/SORTBY

/PulseLoansToday

PulseLoansToday diffgr:id=PulseLoansToday2 
msdata:rowOrder=1

SCHEDDATE01/10/2005/SCHEDDATE

CATEGORY2-USED VEHICLE/CATEGORY

TOTALBAL51179669.7000/TOTALBAL

TOTALCNT4322/TOTALCNT

SORTBY2/SORTBY

/PulseLoansToday

PulseLoansToday diffgr:id=PulseLoansToday3 
msdata:rowOrder=2

SCHEDDATE01/10/2005/SCHEDDATE

CATEGORY3-UNSECURED/CATEGORY

TOTALBAL997362.0700/TOTALBAL

TOTALCNT761/TOTALCNT

SORTBY3/SORTBY

/PulseLoansToday

PulseLoansToday diffgr:id=PulseLoansToday4 
msdata:rowOrder=3

SCHEDDATE01/10/2005/SCHEDDATE

CATEGORY4-EQUITY MORTGAGES/CATEGORY

TOTALBAL11356456.8100/TOTALBAL

TOTALCNT545/TOTALCNT

SORTBY4/SORTBY

/PulseLoansToday

PulseLoansToday diffgr:id=PulseLoansToday5 
msdata:rowOrder=4

SCHEDDATE01/10/2005/SCHEDDATE

CATEGORY5-HELOC FIXED/CATEGORY

TOTALBAL2665131.6800/TOTALBAL

TOTALCNT94/TOTALCNT

SORTBY5/SORTBY

/PulseLoansToday

PulseLoansToday diffgr:id=PulseLoansToday6 
msdata:rowOrder=5

SCHEDDATE01/10/2005/SCHEDDATE

CATEGORY6-HELOC VARIABLE/CATEGORY

TOTALBAL1452584.3100/TOTALBAL

TOTALCNT152/TOTALCNT

SORTBY6/SORTBY

/PulseLoansToday

PulseLoansToday diffgr:id=PulseLoansToday7 
msdata:rowOrder=6

SCHEDDATE01/10/2005/SCHEDDATE

CATEGORY7-FIXED/CATEGORY

TOTALBAL6617278.6300/TOTALBAL

TOTALCNT255/TOTALCNT

SORTBY7/SORTBY

/PulseLoansToday 

/PulseLoansToday

/diffgr:diffgram

/PulseLoansTodayResult

/PulseLoansTodayResponse
 /soap:Body
/soap:Envelope


--- In flexcoders@yahoogroups.com, Tracy
Spratt [EMAIL PROTECTED] 
wrote:
 Well, this is definitely on topic, so lets
keep it here. Besides,
 someone else might be able to help.
 
 An Object is NOT the same as an array of
Objects, at least from a 
list
 dataProvider standpoint. But there has to be
an array in there
 somewhere! Sometimes the array is at
result[0], and not at result.
 
 What are you using to debug? Flex Builder?
Can you examine the 
result
 object?
 Did you try the for loop? If you have
an object, that might not 
work.
 But it might with result[0].
 Also try:
 for (var key in result){
  trace(key +
: + result[key]);
 }
 
 We can also try specifying the result to be
in xml.
 
 We need to know exactly what our data looks
like.
 
 Do the current results display in the
datagrid? If so, how are you
 specifying the dataProvider and the column
sources?
 
 Tracy
 
 -Original Message-
 From: flexcoders@yahoogroups.com 
[mailto:[EMAIL PROTECTED] On
 Behalf Of Dave
 Sent: Thursday