Kevin,
I haven't cleared my cache recently, but I did find out why it wasn't
working. If I just have a cfgrid populated by a query, I can do
myGrid.dataProvider.slice(0) and get a copy of all the items in the
list. I found out the PROBLEM is when I change the data provider with
flash remoting: myGrid.dataProvider = results;
After I do that, slice(0) magically stops returning anything, and if I
get rid of the slice, I get a pointer to the data, not a copy of it. My
work around for now is simply to loop over the dataProvider list and
build a new array one item at a time like this:
var backupDP = [];
for(var i:Number = 0; i < grd_reconcile.dataProvider.length; i++)
{
backupDP.push(grd_reconcile.dataProvider.getItemAt(i));
}
Probably not the most efficient, but it works for now.
It seems every decent language should have a way to copy by reference
AND by value (without a slice(0) hack), but I haven't figured it out yet
with Actionscript.
On a funny note-- I posted a question to the flex livedocs the other day
asking if the columns in a data grid object could be made draggable (in
order to let the users drag them around and order them easily) I got a
reply back from an employee of Macromedia telling me that he didn't know
the answer to my question. Now tell me, if the company who WROTE the
software can't answer questions about it, who can?? He referred me to
the macromedia forumns. Nice try-- I asked that exact question in the
forums a couple weeks ago and never got a SINGLE reply. *sigh*
~Brad
-----Original Message-----
From: Kevin Aebig [mailto:[EMAIL PROTECTED]
Sent: Tuesday, January 10, 2006 9:05 AM
To: CF-Talk
Subject: RE: action script copy by value
Hey Brad,
This may seem a little ridiculous, but have you cleared your cache
lately?
It is still Flash after all...
Cheers,
Kevin
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:229032
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54