[FLEX2] Drag-drop probleem

Pagina: 1
Acties:

  • thalyric
  • Registratie: Februari 2002
  • Laatst online: 14-08-2025
Hoi,

Ik heb 2 datagrids. Ik kan items van DG1 naar DG2 drag and droppen. Probleem is nu dat ik dus een item die ik al een x eerder heb gedropped vanuit DG1 naar DG2 meerdere keren kan dropen. En dat wi lik eigenlijk niet. Normaal zou je dan de item uit DG1 verwijderen, maar dat wil ik dus niet. Iemand een tip voor me?

mijn mxml:

code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" width="700" height="250" borderStyle="solid" creationComplete="initApp();">

    <mx:Script>
        <![CDATA[

                private function initApp():void {
                     srcgrid.dataProvider =                     [
                        {Artist:'Carole King', Album:'Tapestry', Price:11.99},
                        {Artist:'Paul Simon', Album:'Graceland', Price:10.99},
                        {Artist:'Original Cast', Album:'Camelot', Price:12.99},
                        {Artist:'The Beatles', Album:'The White Album', Price:11.99}
                    ];

                    destgrid.dataProvider =[];    
                }
        ]]>
    </mx:Script>

    <mx:HBox>
        <mx:VBox>
            <mx:Label text="Available Albums"/>
            <mx:DataGrid id="srcgrid" allowMultipleSelection="true" 
                dragEnabled="true" dropEnabled="false" dragMoveEnabled="false">
                <mx:columns>
                    <mx:DataGridColumn dataField="Artist"/>
                    <mx:DataGridColumn dataField="Album"/>
                    <mx:DataGridColumn dataField="Price"/>
                </mx:columns>    
            </mx:DataGrid>
        </mx:VBox>

        <mx:VBox>
            <mx:Label text="Buy These Albums"/>
            <mx:DataGrid id="destgrid" allowMultipleSelection="true" 
                dragEnabled="false" dropEnabled="true" dragMoveEnabled="false">
                <mx:columns>
                    <mx:DataGridColumn dataField="Artist"/>
                    <mx:DataGridColumn dataField="Album"/>
                    <mx:DataGridColumn dataField="Price"/>
                </mx:columns>    
            </mx:DataGrid>
        </mx:VBox>
    </mx:HBox>
</mx:Application>

  • SchizoDuckie
  • Registratie: April 2001
  • Laatst online: 18-02-2025

SchizoDuckie

Kwaak

nou ken ik flex niet maar het lijkt met dat je wel op je destgrid een ondrop event kan afvangen en daarin kan kijken of het te-droppen-item al in de lijst staat? Komt deze al voor dan cancel je het event?

Stop uploading passwords to Github!


  • André
  • Registratie: Maart 2002
  • Laatst online: 16-07 14:42

André

Analytics dude

Ik verplaats deze naar Client Software Algemeen