2 Replies Latest reply on Jul 24, 2007 9:31 PM by Ambili

    Data grid -Column data  issue

    Ambili
      Hi,

      i am new to FDS using Flex 2.0.
      Is it possible to the data in a datagrid column while loading the page itself.

      I have a product_list which contains hotel name , rate and status.
      Rate will be obtained from the list as say 345. i want to display it as GBP 345 in datagrid, while page loading
      how can i acheive this from client side ( in actionscript)..?


      My code for datagrid is as follows:

      <mx:DataGrid id="dg" width="100%" rowHeight="38" styleName="GridColumnText"
      dataProvider="{hotel_details}" enabled="{!ds.commitRequired}" creationComplete="fill_hotelDetails()"
      verticalScrollPolicy="{mx.core.ScrollPolicy.OFF}" rowCount="10" height="404">
      <mx:columns >
      <mx:DataGridColumn dataField="hotel_address" headerText="Hotel Name"
      headerStyleName="DynamicLabel" width="300" wordWrap="true" editable="false"/>

      <mx:DataGridColumn id ="pr_rate" dataField="prdt_rate" headerText="Rate" headerStyleName="DynamicLabel" paddingRight="10" editable="false" width="50" />

      <mx:DataGridColumn dataField="hotel_status" headerText="Availabilty"
      headerStyleName="DynamicLabel" editable="false" width="75"/>

      <mx:DataGridColumn headerText="Book Now" editable="false"
      headerStyleName="DynamicLabel" width="75" sortable="false">
      <mx:itemRenderer>
      <mx:Component>
      <mx:HBox width="25%" horizontalCenter="0" horizontalAlign="center"
      styleName="GridColumnText" paddingTop="5">
      <mx:Button id="book" label="Book Now" click="OnBook_click()" />
      <mx:Script>
      <![CDATA[
      public function OnBook_click():void{
      var request:URLRequest = new URLRequest("/quick_search/booking.mxml");
      navigateToURL(request,"_self");
      }
      ]]>
      </mx:Script>
      </mx:HBox>
      </mx:Component>
      </mx:itemRenderer>
      </mx:DataGridColumn>
      </mx:columns>
      </mx:DataGrid>

      In the following code, i want to dispaly pdt_rate as GBP 345. pls any one give suggestions

      thx in advance
      Ambili Surendran