Navigate to URL from DataGrid as selection changed : DataGrid Selection « Grid « Flex






Navigate to URL from DataGrid as selection changed

Navigate to URL from DataGrid as selection changed
        

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical">
    <mx:Script>
        
            import mx.collections.ArrayCollection;
            import flash.net.*;
    
            [Bindable]
            public var list:ArrayCollection;
      
    </mx:Script>
    
    <mx:VBox>
        <mx:DataGrid id="myDG" dataProvider="{list}" width="100%" change="navigateToURL(new URLRequest(myDG.selectedItem.link),'_blank');" >
            <mx:columns>
                <mx:DataGridColumn headerText="Posts" dataField="title" />
                <mx:DataGridColumn headerText="Date" dataField="pubDate" width="100" />
            </mx:columns>
        </mx:DataGrid>
        
    </mx:VBox>
</mx:Application>

   
    
    
    
    
    
    
    
  








Related examples in the same category

1.Remove selected item from DataGridRemove selected item from DataGrid
2.Get selected index from DataGridGet selected index from DataGrid
3.DataGrid allows Multiple SelectionDataGrid allows Multiple Selection
4.Handling a user interaction by passing the event object to a functionHandling a user interaction by passing the event object to a function