|
View:
New views
2 Messages
—
Rating Filter:
Alert me
|
|
|
Add a link to a file in a datagridHello,
I'm trying to add a button in a datagrid that, when clicked, will allow the user to download a pdf file. DATAGRID: <mx:DataGrid id="dgTips" x="126" y="10" width="210" height="50" textAlign="center" dataProvider="{dgData}" showEffect="{dgTipsWipe}" useRollOver="true"> <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="Price" dataField="price" width="60"/> <mx:DataGridColumn headerText="Drawing" dataField="pdf" width="80"> <mx:itemRenderer> <mx:Component> <mx:Button click="navigateToURL(new URLRequest(data.@pdf))" icon="@Embed('/assets/icon_pdf.png')"/> </mx:Component> </mx:itemRenderer> </mx:DataGridColumn> </mx:Array> </mx:columns> </mx:DataGrid> ACTIONSCRIPT: public var productId:int; public var tipId:int; public var name:String; public var description:String; public var series:String; public var model:String; public var alloy:Boolean; public var carbide:Boolean; public var hss:Boolean; public var price:Number; public var image:String; public var plas:Number; public var wire:Number; public var a:Number; public var b:Number; public var c:Number; public var d:Number; public var e:Number; public var pdf:String; XML: <tip tipId="1"> <name>ITEMNAME</name> <description>ITEM DESCRIPTION</description> <series>ABC</series> <model>MODEL</model> <alloy>true</alloy> <carbide>false</carbide> <hss>false</hss> <price>00.00</price> <image>assets/pic/abc_button.gif</image> <plas>2</plas> <wire>0</wire> <a>20</a> <b>7</b> <c>5</c> <d>7</d> <e>2.5</e> <pdf>assets/pdf/abc.pdf</pdf> </tip> I can't figure out what I'm missing. Any help would be greatly appreciated. Thanks. |
|
|
|
| Free Forum Powered by Nabble | Forum Help |