6 Replies Latest reply on Oct 1, 2008 8:04 AM by Flashcqxg

    Flex3:How to read the CFJSON's encode json string?

    Flashcqxg
      i worked with ColdFusion7 and CFJSON,in my one cfm file,it makes a json string by CFJSON's encode method,the string like:
      {"recordcount":5,"columnlist":"url,title","data":[{"url":"110101","title":"110101test"},{" url":"110102","title":"110102test"},{"url":"110103","title":"110103test"},{"url":"110104", "title":"110104test"},{"url":"110105","title":"110105test"}]}

      In my Flex client ,i use the corelib(com.adobe.serialization.json.*) to read this JSON string,but the grid show nothing,my code:
      jsonString = String(event.result.data);
      var arr:Array = (JSON.decode(jsonString) as Array);
      var dp:ArrayCollection = new ArrayCollection(arr.data);
      grid.dataProvider = dp;

      what can i do to left the grid show data?
      Thank a lot.