xml version encoding utf-8 AxnPopUp xmlns com axn view base xmlns mx h

 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
46
47
48
49
50
<?xml version="1.0" encoding="utf-8"?>
<AxnPopUp xmlns="com.axn.view.base.*" xmlns:mx="http://www.adobe.com/2006/mxml" width="592" height="466"
layout="absolute" xmlns:view="com.axn.publishers.view.*" title="AthletixNation Widget Publishers">
<mx:Script>
<![CDATA[
import mx.controls.Alert;
import com.axn.publishers.builder.BuilderSession;
import mx.collections.ArrayCollection;
import com.axn.session.SessionBase;
[Bindable] private var _publishers:ArrayCollection = new ArrayCollection();
public function init( session:SessionBase, publishers:ArrayCollection ):void {
BuilderSession.instance.copyState( session );
fetchPublishers();
}
//Call this method from this view when you want to load the publishers
public function fetchPublishers():void {
BuilderSession.instance.showLoading( BuilderSession.CONTEXT_LOADING_PUBLISHERS );
BuilderSession.instance.fetchPublishers( fetchPublishersHandler );
}
private function fetchPublishersHandler( success:Boolean ):void {
if( success )
_publishers.source = BuilderSession.instance.publishers.source;
else
Alert.show( "Could not load publishers.", "Error" );
BuilderSession.instance.hideLoading( BuilderSession.CONTEXT_LOADING_PUBLISHERS );
}
]]>
</mx:Script>
<mx:DataGrid selectable="false" dataProvider="{_publishers}" id="_dataGrid" top="10" bottom="67" left="10" right="6">
<mx:columns>
<mx:DataGridColumn headerText="№" dataField="number" width="50"/>
<mx:DataGridColumn headerText="Type" dataField="host_url" width="80"/>
<mx:DataGridColumn headerText="Name" dataField="avg"/>
<mx:DataGridColumn headerText="City" dataField="support_email"/>
<mx:DataGridColumn headerText="State" dataField="ts_created" width="50"/>
<mx:DataGridColumn headerText="DMA City" dataField="dma_city"/>
<mx:DataGridColumn headerText="Rank" dataField="dma_rank" width="50"/>
</mx:columns>
</mx:DataGrid>
<mx:TextArea x="10" y="367" width="552" id="debugTA"/>
</AxnPopUp>