Hi Tom,
Hopefully the sample code below will be enough to get you started. Once the repeated grids have had their dataproviders bound to an array, all you need to do is reassign another array to update the grid just as the "Update grids" button in the sample does. The sample accomplishes this reassignment with the Array.slice() method. You could also use the various grid and dataprovider methods (addItem(), replaceItem(), editField(), etc) to make changes on a row-by-row basis. You should be able to use a remote object result handler in place of the button's click handler to update the dataprovider arrays.
I'll leave the drag-and-drop portion to you, but essentially I believe everything you require should be in the event parameter: event.target, event.dragSource, etc.
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml" width="100%">
<mx:Script>
<![CDATA[
var repeaterData: Array = [ {}, {}, {} ];
function updateData() : Void {
var n: Number = 0;
for (var i = 0; i < repeaterData.length; i++) {
var dp: Array = repeaterData[i].dp;
if (dp == undefined) {
repeaterData[i].dp = [{Number: n++}, {Number: n++}, {Number: n++}];
}
else {
for (var j = 0; j < dp.length; j++) {
dp[j].Number++;
}
repeaterData[i].dp = dp.slice();
}
}
}
]]>
</mx:Script>
<mx:Panel title="Repeated Data Grids" width="80%">
<mx:HBox width="100%">
<mx:Repeater id="rp" dataProvider="{repeaterData}">
<mx:DataGrid dataProvider="{rp.currentItem.dp}" width="100%"/>
</mx:Repeater>
</mx:HBox>
<mx:ControlBar>
<mx:Button label="Update grids" click="updateData()"/>
</mx:ControlBar>
</mx:Panel>
</mx:Application>
--- In [email protected], Tom Sammons <[EMAIL PROTECTED]> wrote:
>
> Hi all,
>
> Long time viewer, first time caller... [never mind, it's a pittsburgh thing]
>
> What I'm trying to accomplish is to populate a regular datagrid with
> records representing unassigned requests, and then use a repeater to
> display grids of current workload requests for a short list of
> personnel. An administrator would drag and drop unassigned requests
> into the workload grids, and be able to drag/drop between workload grids
> as well for the purpose of balancing/spreading personnel work around.
> (Eventually, I want to be able to use shared objects to automatically
> update at the client level as well to improve the collaboration, but
> that's a different effort.)
>
> I've been unable to find a suitable example or solution that would
> demonstrate how one would set the dataProvider for datagrids generated
> by a Repeater. Obviously, if I bind the provider during Repeater
> execution it will populate all the grids with the last remote object
> call. (I'm not at all interested in using XML, although even that would
> give me a lead.) From a performance aspect, I'm not positive that the
> repeater may not be the best way to go -- although Tracy posted
> something that says otherwise in 18378 -- but the workload grids will
> generally only be between 3 and 6 in count, and the repeater seems to
> handle that quite well from what I've seen so far, plus takes care of
> all the nice formatting. Just so you know, F2 isn't an option right now.
>
> I'd really appreciate it if someone could provide an example of how I
> can populate the repeater grids with different remote object calls, and
> how I would use the event.target.getRepeaterItem during the drag
> function (since I'm not sure how to use that to reference a specific
> datagrid id in the repeater array --- did I say that right?). I think
> once I have the former, I could figure out how to get all the other
> information I need. I already know how to pass entire datagrid
> structures to ROs for updates, so I just need a friendly jumpstart to
> get my head around this Repeater stuff.
>
> Any help or pointers would be greatly appreciated, and I'll post the
> working code for others who might be interested as well.
>
> Tom
>
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
| Web site design development | Computer software development | Software design and development |
| Macromedia flex | Software development best practice |
YAHOO! GROUPS LINKS
- Visit your group "flexcoders" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

