1 Reply Latest reply on Sep 3, 2009 8:06 AM by Andrew Rosewarn

    Data in XML vs. Modified with LabelFunction

    DHTVP Level 1



      We have a datagrid that is being populated through an HTTPService call that generates an XML via PHP.

      We are wondering which of these two scenarios would be faster in terms of load/render times:


      a) Load all the data in the XML directly, hence increasing the size of the XML (simplified example below):

      <item status="Read"/>




      b) Load ID values in the XML, keeping XML file size down and placing a labelFunction on the DataGrid where Actionscript would set the values:

      <item status="1"/>


      private function dgFormatDate(item:Object, column:DataGridColumn):String


           if(column.dataField == "@status") {

                if(item[column.dataField] == "1"){

                     var status:String = "Read";

                     return status;



           return item[column.dataField];





        • 1. Re: Data in XML vs. Modified with LabelFunction
          Andrew Rosewarn Level 3

          I guess it comes doen to how much xml there is.  To be honest I'd for the first option (and have in the past)  and aviod the labelFunction logiv for each item.  This will increase your maintence time when you change or edit a node etc.


          Also I would imagine its quicker for the player to handle the xml, and render wise, not to have to run label function logic for each node.


          I think what you should realy be thinking about is more lazy loading.  How many xml records you realy need.  Ie work more towards showing a it of data, then when the user drills down, go back to the server to load more.


          Just my thoughts



          1 person found this helpful