Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / Flash / Flash Remoting / December 2006



Tip: Looking for answers? Try searching our database.

possible to make a *copy* of a RecordSet

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
sneakyimp - 13 Apr 2006 02:29 GMT
i have a SWF that remotes a fairly large RecordSet (~1800 records).  It's a
list of products and some info about them.

I'm writing some code to let a store administrator associate products with
each other ( so the site says "These other Companion Prodcuts  might interest
you").  I therefore have to list one record set of 1800 products simultaneously
in two different data grids.  the first to list the products and load the
'Companion Products' list.  the other to let the admin choose which products to
associate.

Is it possible to COPY a dataset returned from a remoting call?  I have my app
working right now but each instance of the productListDataGrid that I have on
my flash movie calls the list from the server independently.  I was thinking it
would be more efficient to call the list once and split it into two copies--one
for each dataGrid.  Can this be done?
jag57 - 23 Apr 2006 19:16 GMT
All you have to do is something like this:

var myRS:RecordSet = myService.getData();
myDataGrid.dataProvider = myRS;
myOtherDataGrid.dataProvider = myRS;

You can put those lines in a function and call it once.

I hope this helps.
sneakyimp - 26 Apr 2006 19:17 GMT
the problem with assigning the same record set to both data grids is that if you sort or filter one, you sort or filter the other.  this is not acceptable.  the two dataGrids must be kept separate.
jag57 - 26 Apr 2006 21:06 GMT
Then couldn't you do:

var myRS:RecordSet = myService.getData();
var myRSCopy:RecordSet = myRS;
dg.dataProvider = myRS;
otherDG.dataProvider = myRSCopy;

Then you can sort each RecordSet individually.  I hope I'm understanding you
correctly.  Tell me if you still need help.
turbidity - 04 Dec 2006 01:52 GMT
Also, look at the RecordSet class' filter method. It allows you to filter a RecordSet and create a second Recordset from it.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.