13 Replies Latest reply on Jul 14, 2008 8:12 AM by heypachuco

    Link to a file in a Datagrid

    heypachuco
      Hello,
      I have a datagrid thats populated from a XML file. In one of the columns I'd like to have a button that, when clicked, will link to a PDF drawing of that particular item.

      Here's my code so far:

      <mx:DataGrid id="dgTips" x="135" y="65" width="209" height="50" textAlign="center" dataProvider="{tip}">
      <mx:columns>
      <mx:Array>
      <mx:DataGridColumn headerText="A" dataField="a" width="30"/>
      <mx:DataGridColumn headerText="B" dataField="b" width="30"/>
      <mx:DataGridColumn headerText="C" dataField="c" width="30"/>
      <mx:DataGridColumn headerText="D" dataField="d" width="30"/>
      <mx:DataGridColumn headerText="E" dataField="e" width="30"/>
      <mx:DataGridColumn headerText="Drawing" dataField="image" width="50">
      <mx:itemRenderer>
      <mx:Component>
      <mx:Button click="" icon="@Embed('/assets/icon_drawing.png')"/>
      </mx:Component>
      </mx:itemRenderer>
      </mx:DataGridColumn>
      </mx:Array>
      </mx:columns>
      </mx:DataGrid>

      In my XML file, each item has a field with the path to it's PDF file. Can anyone tell me how to configure the button?
      Any help is appreciated.
      Thanks.