Thanks Ryan guess was kind of tired had failed looking at some of the points
rather was not getting the point. Finally I'm through this is the final
product:

{"rsJson":[{"groupCode":"1","groupName":"Roses","flowerSet":{"flowers":[{"flowerCode":"15","flowerName":"Roses"}]}},{"groupCode":"2","groupName":"Carnations","flowerSet":{"flowers":[{"flowerCode":"16","flowerName":"Spray
Carnations"},{"flowerCode":"17","flowerName":"Standard
Carnations"}]}},{"groupCode":"3","groupName":"Perennials","flowerSet":{"flowers":[{"flowerCode":"2","flowerName":"Aster"},{"flowerCode":"3","flowerName":"Alstromeria"},{"flowerCode":"10","flowerName":"Gysophila"},{"flowerCode":"12","flowerName":"Limonium
Perezzi"}]}},{"groupCode":"4","groupName":"Annuals","flowerSet":{"flowers":[{"flowerCode":"1","flowerName":"Ammi
Majus"},{"flowerCode":"4","flowerName":"Bupleurum"},{"flowerCode":"5","flowerName":"Carthamus"},{"flowerCode":"6","flowerName":"Chinese
Aster"},{"flowerCode":"7","flowerName":"Chrysantemum"},{"flowerCode":"8","flowerName":"Delphinium"},{"flowerCode":"13","flowerName":"Lisianthus"},{"flowerCode":"14","flowerName":"Molucella"},{"flowerCode":"18","flowerName":"Statice"},{"flowerCode":"19","flowerName":"Stocks"}]}},{"groupCode":"5","groupName":"Bulbs","flowerSet":{"flowers":[{"flowerCode":"9","flowerName":"Freesia"},{"flowerCode":"11","flowerName":"Lilies"}]}}]}

kind regards
Jason

On Wed, Dec 17, 2008 at 8:04 PM, jason maina <jason.ma...@gmail.com> wrote:

> What im wondering out of the reply is I cant have a nested JSON object with
> the following layout?
>
> groupID, groupName, groupItems(array of items)
>
> similar example:
>
> http://labs.adobe.com/technologies/spry/samples/data_region/JSONDataSetSample.html#Example5
>
> Regards,
> Jason
>
>
>
> On Wed, Dec 17, 2008 at 7:02 PM, Ryan Gahl <ryan.g...@gmail.com> wrote:
>
>> typo... "...with NO properties"
>>
>>
>>
>> On Wed, Dec 17, 2008 at 10:02 AM, Ryan Gahl <ryan.g...@gmail.com> wrote:
>>
>>> Here are your problems... I'll remove the bulk of the data to make it
>>> more clear:
>>>
>>> rsJson: {[{...}]}
>>>
>>> what you have is illegal. You're essentially saying you have an anonymous
>>> object with not properties and filling it with an array (that's probably not
>>> even totally accurate)... the bottom line is, you can't have a curly brace
>>> immediately followed by a square brace. And going further you have it all
>>> just sitting in a property floating in space. The first thing you need to do
>>> is wrap the property in curlies so you're actually returning an object...
>>>
>>> {rsJson: ...}
>>>
>>> Now, this other issue of putting a square bracket right inside a curly...
>>> You can either a) remove the outer curlies and just make rsJson be an array,
>>> or b) add a property name which then becomes the array.
>>>
>>> a)
>>> {rsJson: [{}, {}, ...]}
>>>
>>> b)
>>> {rsJson: {myArray: [...]}}
>>>
>>>
>>>
>>>
>>> On Wed, Dec 17, 2008 at 9:53 AM, jason maina <jason.ma...@gmail.com>wrote:
>>>
>>>> Hi all,
>>>> Below is JSON encoded(php) data. After evaluating and sanitizing it im
>>>> not capable of extracting its contents im just not sure what im doing 
>>>> wrong:
>>>>
>>>> [php output]
>>>>
>>>>
>>>> rsJson:{[{"groupCode":"1","groupName":"Roses","flowers":[{"flowerCode":"15","flowerName":"Roses"}]},
>>>> {"groupCode":"2","groupName":"Carnations","flowers":[{"flowerCode":"16","flowerName":"Spray
>>>> Carnations"
>>>> },{"flowerCode":"17","flowerName":"Standard
>>>> Carnations"}]},{"groupCode":"3","groupName":"Perennials"
>>>>
>>>> ,"flowers":[{"flowerCode":"2","flowerName":"Aster"},{"flowerCode":"3","flowerName":"Alstromeria"},{"flowerCode"
>>>> :"10","flowerName":"Gysophila"},{"flowerCode":"12","flowerName":"Limonium
>>>> Perezzi"}]},{"groupCode":"4"
>>>> ,"groupName":"Annuals","flowers":[{"flowerCode":"1","flowerName":"Ammi
>>>> Majus"},{"flowerCode":"4","flowerName"
>>>> :"Bupleurum"},{"flowerCode":"5","flowerName":"Carthamus"},{"flowerCode":"6","flowerName":"Chinese
>>>> Aster"
>>>>
>>>> },{"flowerCode":"7","flowerName":"Chrysantemum"},{"flowerCode":"8","flowerName":"Delphinium"},{"flowerCode"
>>>>
>>>> :"13","flowerName":"Lisianthus"},{"flowerCode":"14","flowerName":"Molucella"},{"flowerCode":"18","flowerName"
>>>>
>>>> :"Statice"},{"flowerCode":"19","flowerName":"Stocks"}]},{"groupCode":"5","groupName":"Bulbs","flowers"
>>>>
>>>> :[{"flowerCode":"9","flowerName":"Freesia"},{"flowerCode":"11","flowerName":"Lilies"}]}]}
>>>>
>>>> [php output]
>>>>
>>>> var jsonObj = res.responseText.evalJSON(true);
>>>> alert(jsonObj);
>>>>
>>>> will not even popup, on firebug no errors showing up.
>>>>
>>>> Kind regards
>>>> Jason
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>> --
>>> Ryan Gahl
>>> CEO
>>> Nth Penguin, LLC
>>> http://www.nthpenguin.com
>>> --
>>> WebWidgetry.com / MashupStudio.com
>>> Future Home of the World's First Complete Web Platform
>>> --
>>> Inquire: 1-920-574-2218
>>> Blog: http://www.someElement.com
>>> LinkedIn Profile: http://www.linkedin.com/in/ryangahl
>>>
>>
>>
>>
>> --
>> Ryan Gahl
>> CEO
>> Nth Penguin, LLC
>> http://www.nthpenguin.com
>> --
>> WebWidgetry.com / MashupStudio.com
>> Future Home of the World's First Complete Web Platform
>> --
>> Inquire: 1-920-574-2218
>> Blog: http://www.someElement.com
>> LinkedIn Profile: http://www.linkedin.com/in/ryangahl
>>
>> >>
>>
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to