DATAPROVIDER LENGTH - PLEASE HELP
I am not sure if this is a Flex bug or just the wrong approach. I have two datagrids that have drag-drop enabled. I followed the drag and drop example from Macromedia (Flex Explorer) When I hit the doDragDrop function, instead of simply adding the items to the grid, I also want to add them to a global array named TestArray. I assign the items to the array and I can browse the contents of the array during my debugging process. However, the length of the array and the length of the datagrid dataProvider is set to 0! Althought there are items inside the grid. Why does this happen? Is it because the array is un-accessible in the scope of the event? PLEASE HELP Alex
DATAPROVIDER LENGTH
I have two grids(source and destination) and I am using drag-and- drop to populate the destination grid. I have this working and items are moved (sort-of) over to the grid. During debugging, I browsed to see the items available in the dataProvider for the grid. Items are there but the length of the dataProvider is = 0 ?? So, destinationgrid.dataProvider has the following items: +0 with subfields +1 with subfields +2 with subfields Length should be 3. It shows 0. Any ideas? Here is my dragdrop function == function doDragDrop(event) { var match_count:Number = 0; doDragExit(event); var items = event.dragSource.dataForFormat(items); var destination = event.target var exist_items = destination.items; var dropLoc = dest.getDropLocation() items.reverse() for(var i = 0; i items.length; i++) { destination.addItemAt(dropLoc, items[i]); } } Alex
Re: [flexcoders] DATAPROVIDER LENGTH
gevgelija50 wrote: I have two grids(source and destination) and I am using drag-and- drop to populate the destination grid. I have this working and items are moved (sort-of) over to the grid. During debugging, I browsed to see the items available in the dataProvider for the grid. Items are there but the length of the dataProvider is = 0 ?? if the length is 0 then it won't show any items. can you post some sample code to demonstrate the problem? are you querying the property of the grid's dataprovider directly using myDataGrid.dataProvider.length?