1 | <?xml version="1.0" encoding="utf-8"?>
|
---|
2 | <mx:Label
|
---|
3 | xmlns:mx="http://www.adobe.com/2006/mxml">
|
---|
4 |
|
---|
5 | <mx:Script>
|
---|
6 | <![CDATA[
|
---|
7 | import mx.controls.listClasses.ListBase;
|
---|
8 | import mx.controls.dataGridClasses.DataGridListData;
|
---|
9 | import gov.va.med.edp.model.TrackingModelLocator;
|
---|
10 | import gov.va.med.edp.vo.LookupVO;
|
---|
11 | import gov.va.med.edp.util.Vista;
|
---|
12 |
|
---|
13 | private var model: TrackingModelLocator = TrackingModelLocator.getInstance();
|
---|
14 | private var _data: Object;
|
---|
15 |
|
---|
16 | override public function set data(value: Object): void {
|
---|
17 | _data = value;
|
---|
18 | if (value == null) return;
|
---|
19 |
|
---|
20 | var status: Number = value[DataGridListData(listData).dataField];
|
---|
21 | var i: int = Vista.locateIndex(model.config.statusList, status);
|
---|
22 | if (i > -1) {
|
---|
23 | this.text = LookupVO(model.config.statusList[i]).label;
|
---|
24 | } else {
|
---|
25 | this.text = "";
|
---|
26 | }
|
---|
27 | }
|
---|
28 |
|
---|
29 | override public function get data(): Object {
|
---|
30 | return _data;
|
---|
31 | }
|
---|
32 |
|
---|
33 | override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
|
---|
34 | {
|
---|
35 | super.updateDisplayList(unscaledWidth, unscaledHeight);
|
---|
36 |
|
---|
37 | if(owner is mx.controls.DataGrid && mx.controls.DataGrid(owner).isItemSelected(data)) { //figure out if this itemRenderer is selected
|
---|
38 | setStyle('color', 0xFFFFFF); // FIXME: anyway to discover this value from the theme?
|
---|
39 | } else { //otherwise, return the label to its regular state
|
---|
40 | setStyle('color', 0x000000); // FIXME: anyway to discover this value from the theme?
|
---|
41 | }
|
---|
42 | }
|
---|
43 | ]]>
|
---|
44 | </mx:Script>
|
---|
45 |
|
---|
46 | </mx:Label> |
---|