since ‎01-09-2008
‎10-12-2019
Stinky_Tofu
Level 1
Datagrid and percentage formatting
Avatar

Stinky_Tofu

Stinky_Tofu
- Adobe LiveCycle
I am having some difficulty rendering percentages in theDataGrid. I have the following JSON file structure:{"n":"Zimbabwe","o":"63%","m":"38%","g":"1,900"}When I import these values into the DataGrid, there is aproblem when I try to sort the percentage columns. The percentagesare not sorted in the correct order, resulting in something likethis:0%100%14%17%etc..Instead of:0%14%17%100%So, I tried changing the JSON file to:{"n":"Zimbabwe","o":"63","m":"38","g":"1900"}However, now I am having proble...

Views

534

Likes

0

Replies

2
Flex and JSON
Avatar

Stinky_Tofu

Stinky_Tofu
- Adobe LiveCycle
I am having some trouble getting the JSON.decode() methodworking.I currently have the following JSON file in UTF-8 format:{"states":[{"id":140,"state":"Alabama","obama":6,"mccain":5,"ec":3},{"id":91,"state":"Alaska","obama":4,"mccain":5,"ec":3}],"USA":{"obama":7450, "mccain":7450}}I am accessing it in Flex with the following code:private function onJSONLoad(event:ResultEvent):void{ var rawData:String = String(event.result); var countries:Array = (JSON.decode(rawData) as Array); Alert.show(countries.length as String); var dp:ArrayCollection = new ArrayCollection(arr); voteTable.dataProvider = dp;}]]>However, for the life of me, I cannot get Flex to correctlyparse the JSON code into an array. In the line:var countries:Array = (JSON.decode(rawData) as Array);The coun...

Views

241

Likes

0

Replies

0