-
1 Jun 2012 10:07 AM #1
Parsing data into JSON
Parsing data into JSON
Hi,
i've a form containing 2 fieldset. Every fieldset have these fields:
- author
- title
- date
if i do this:
the result is:PHP Code:Ext.JSON.encodeValue(form.getValues()),
{"author":["a1","a2"],"title":["t1","t2"],date:["d1","d2"]}
while i want to submit a json like this
[{"author":"a1","title":"t1","date":"d1"},{"author":"a2","title":"t2","date":"d2"}]
how can i do?
thanks a lot
-
1 Jun 2012 10:23 AM #2
Provide a unique name (name: 'author1') to each field.
Regards,
Scott.
-
2 Jun 2012 12:17 AM #3
of course but than i don't have the inner detail.
with your solution i have a json like this:
[{"author1": ["a1","t1","d1"],"author2":["a2","t2","d2"]}
and it is different from:
[{"author":"a1","title":"t1","date":"d1"},{"author":"a2","title":"t2","date":"d2"}]
-
2 Jun 2012 5:54 AM #4
Please show the code for your form.
Scott.


Reply With Quote