Re: [flexcoders] Help Needed - Removing Item from tileList

2005-05-05 Thread Manish Jethani
On 5/5/05, David Terry [EMAIL PROTECTED] wrote:

 function doDragComplete(event) 
 
   { 
 
  var dragItems =
 event.dragSource.dataForFormat(source).selectedItems; 
 
  var counter = dragItems.length; 
 
  for (var i=0;icounter;i++) 
 
  { 
 
 var item = dragItems[i]; 
 
 item.removeTreeNode(); 
 
  } 
 
   } 

I think 'selectedItems' will return new array (make sense, but I'm not
sure).  Instead, you could use 'selectedIndices' to get the indices of
the selected items and then use removeItemAt() on the TileList.


 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 




RE: [flexcoders] Help Needed - Removing Item from tileList

2005-05-05 Thread Matt Chotin










I would use the selectedIndices instead
and call removeItemAt. removeTreeNode is used for Trees.



Matt











From:
flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of David Terry
Sent: Thursday, May 05, 2005 8:30
AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Help Needed
- Removing Item from tileList





Hello,



I have another newbie question



I am trying to remove an item from a tileList control
after dropping the item onto a Canvas control. I know something is not
right, but where am I going wrong.



Many thanks,

David T.





Code

*



mx:TileList 

dataProvider={catalog.product}
width=180 height=594 

cellRenderer=lstThumbnail x=10
y=38 borderColor=#CC borderThickness=1 

highlightColor=#FF
dragEnabled=true backgroundColor=#FF 

barColor=#FF
rollOverColor=#FF selectionColor=#F0F0F0 

columnCount=1 borderStyle=solid
itemWidth=160 /



mx:Canvas x=211 y=38
id=cvsCanvas width=459 height=594 

borderThickness=1
borderStyle=solid 

borderColor=#CC
backgroundColor=#F9F9F9

dragEnter=doDragEnter(event)

dragExit=doDragExit(event)

dragDrop=doDragDrop(event)

dragOver=doDragOver(event) 

dragComplete=doDragComplete(event)

vScrollPolicy=off
hScrollPolicy=off /





function doDragEnter(event) {


event.handled=true;

}



function doDragExit(event) {


event.target.hideDropFeedback();

}



function doDragOver(event) {


event.target.showDropFeedback();

}



function doDragDrop(event) {


doDragExit(event);


var item = event.dragSource.dataForFormat(items);





//Alert.show(item[0].height, Alert Box,Alert.OK);


//Alert.show(item[0].name, Alert Box,Alert.OK);





/*if (item != undefined) {


item.mapX = event.target.mouseX - item.mouseInitX;


item.mapY = event.target.mouseY - item.mouseInitY;


}*/




//cvsCanvas.createChild(mx.controls.Image, item[0].name,
{x:event.target.mouseX, y:event.target.mouseY, source:item[0].image,
height:'100', width:'100'});




cvsCanvas.createChild(cvsElement, , {


x:event.target.mouseX, 


y:event.target.mouseY,


source: item[0].image


});



}



function doDragComplete(event) 

 {

 var
dragItems = event.dragSource.dataForFormat(source).selectedItems;

 var
counter = dragItems.length;

 for (var
i=0;icounter;i++)

 {


var item = dragItems[i];


item.removeTreeNode();

 }

 }














Yahoo! Groups Links

To visit your group on the web, go to:http://groups.yahoo.com/group/flexcoders/
To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.