1 Reply Latest reply on Nov 20, 2008 8:18 AM by glen08

    Process XML data in DataTipFunction

    glen08 Level 1
      I'm using AdvancedDataGrid. My dataTipFunction is defined as:

      private function showTip(item:Object):String{
      var tempString:String = item.toString;
      return tempString;

      It shows something like this in the tip window:

      <product id="10">
      <brand>Diet Coke</brand>

      I only want to extract one value without tags. I changed the DataTipFunction to:

      private function showTip(item:Object):String{
      var tempString:String = item.production.brand;
      return tempString;

      Received following error:
      ReferenceError: Error #1069: Property product not found on mx.controls.advancedDataGridClasses.AdvancedDataGridColumn and there is no default value.
      at com.bao.components::SodaShop/showTip()[C:\Users\Jim\flex3workspace\src\com\bao\components \SodaShop.mxml:18]
      at mx.controls.advancedDataGridClasses::AdvancedDataGridColumn/itemToDataTip()[C:\work\flex\ dmv_automation\projects\datavisualisation\src\mx\controls\advancedDataGridClasses\Advanced DataGridColumn.as:1443]

      I also tried HitData type instead of Object, but get Type Coercion error.

      Is there an easy way to parse XML in DataTipFunction?