PDA

View Full Version : JsonStore and required json format



mohaaron
4 Jun 2009, 12:03 PM
Can anyone tell me how I am supposed to produce the json string for the JsonStore. I am having some problems doing this using asp.net mvc and the JsonResult object.

I have the idea that the format of the string is supposed to be something like the following.

{results:value,rows:[{field:value, field:value}]}

The problem I'm having is that every method I've tried to produce this has not worked. All of the serialize methods I have tried produce this.
[{"Code":0,"Label":"Not Processed"},{"Code":1,"Label":"Wish List"},{"Code":2,"Label":"Review Soon"},
{"Code":3,"Label":"Subsequent Release"},{"Code":4,"Label":"Scheduled for Release"},{"Code":5,"Label"
:"Immediate Build/Patch"},{"Code":8,"Label":"Refused"},{"Code":9,"Label":"Non-Problem"}]So it's missing the root:rows value that I am using in my JsonStore declaration.

How is this supposed to work?

evant
4 Jun 2009, 2:05 PM
Once again, you'd get better mileage posting server side specific questions on a different forum.

tryanDLS
4 Jun 2009, 2:08 PM
Asking the same question in multiple places isn't going to get you an answer any faster. If you continue this practice, people will ignore you. You have been advised already to consult a .net forum - this isn't an Ext issue.

mohaaron
4 Jun 2009, 2:47 PM
Hello,

I was trying to ask a different question here and I thought starting a new thread for it would have been the appropriate way to do this. I'm sorry if this is wrong.

I'll try and be more clear. I had started this thread as a means of asking a specific question regarding how the json creating is done. I've seen very little in the way of examples for creating and consuming json. The examples that I have seen tend to be php and then they also tend to send back only the data part of the json and do not include the results: and rows: portion of the json.

So I was wondering how the results: and rows: portion of the json gets included as I was not seeing this anywhere.

Again, I'm sorry if I had double posted a subject, that was not my intent.

Regards,

Aaron