| 123456789101112131415161718192021222324252627282930313233343536 |
- <?xml version="1.0" encoding="utf-8"?>
- <mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml"
- horizontalAlign="center">
- <mx:Script>
- <![CDATA[
- import com.imt.intimamedia.model.ApplicationModelLocator;
- import com.imt.intimamedia.vo.TreatmentVo;
-
- import mx.controls.DataGrid;
- override public function set data(value:Object):void
- {
- super.data = value;
- }
-
- private function removeItem() : void
- {
- for each (var treatmentVo : TreatmentVo in ApplicationModelLocator.getInstance().appointmentSelected.treatmentCollection)
- {
- if (treatmentVo.name == ( owner as DataGrid ).selectedItem.name)
- {
- var idx : int = ApplicationModelLocator.getInstance().appointmentSelected.treatmentCollection.getItemIndex(treatmentVo);
- ApplicationModelLocator.getInstance().appointmentSelected.treatmentCollection.removeItemAt(idx);
- break;
- }
- }
-
- parentDocument.listTreatments.removeItemAt( ( owner as DataGrid ).selectedIndex );
- ApplicationModelLocator.getInstance().appointmentSelected.treatments = parentDocument.listTreatments.source;
- }
- ]]>
- </mx:Script>
-
- <mx:Image source="@Embed('images/report/delete.png')" click="removeItem()" useHandCursor="true" buttonMode="true" left="5" />
-
- </mx:VBox>
|