PDA

View Full Version : Question on Designer



cracknix
21 Sep 2010, 2:59 AM
Hi,
i'm testing the designer an having trouble using a JSON as Store:

This is my URL: http://localhost:17870/home/getTags

This is the returning JSON: ["java","c#","mssql","oracle","sap"]

in the designer when i use right mouse button i says also "5 records loaded"

but when i try to assign it to a combo box or grid, on preview nothing shows up.
whats wrong?

thanks. dave.

jay@moduscreate.com
21 Sep 2010, 5:01 AM
Hi,
i'm testing the designer an having trouble using a JSON as Store:

This is my URL: http://localhost:17870/home/getTags

This is the returning JSON: ["java","c#","mssql","oracle","sap"]

in the designer when i use right mouse button i says also "5 records loaded"

but when i try to assign it to a combo box or grid, on preview nothing shows up.
whats wrong?

thanks. dave.

Dave, that's not JSON, that's Array data.

cracknix
21 Sep 2010, 5:12 AM
right, but is it anyway to use it directly with with this format. arraylist store in designer doesnt work either.

format is still json conform (i guess) its generated by ASP.NET MVC2 like this

public JsonResult getTags()
{
List<string> hb = new List<string>();
...
return this.Json(hb, JsonRequestBehavior.AllowGet);
}

jay@moduscreate.com
21 Sep 2010, 5:18 AM
What is the array store configuration that designer is exporting?

cracknix
21 Sep 2010, 6:33 AM
i attached all information i could determine to get "the big picture"

jay@moduscreate.com
21 Sep 2010, 6:54 AM
Moved to Designer Help and discussion.

To be honest, as an Ext JS developer, I'm used to specifying fields for a store and mapping them in the combo. I honestly don't know how well the auto-field mapping works.

My thoughts are :
- Specify fields for the store
- map them to the combo


things should work from there.

cracknix
21 Sep 2010, 11:57 PM
so now, is extjs or the designer not able to handle a json
string like this:

["java","c#","mssql","oracle","sap"]

if extjs can handle it, how about the js code?

if my data gets just gets bigger for a simple string list, to have fields or more complex
json would create more overhead. thats why i hate xml.

evant
22 Sep 2010, 12:32 AM
If you're using a Json Reader, it expects data in the form:



[{
key1: val1,
key2: val2
},{
key1: val3,
key2: val4
}]

jarrednicholls
23 Sep 2010, 11:15 AM
Evan is correct...an array of strings is not readable by the JsonReader. It expects an array of objects at the very least (if root is not specified).