PDA

View Full Version : Error when load combo in remote mode



randielCoder
13 Jan 2011, 11:37 AM
I need a combobox in remote mode, but i get an error about "Record" object.
My code is:



var store = new Ext.data.JsonStore({
storeId: 'getBuscaFabricaProducto',
autoload: 'false',
url: 'http://localhost/prueba/BuscaFabricaProducto'
});



The error is in the line number 25421 in ext-all-debug.js file:


var s = this.meta, Record = this.recordType,
f = Record.prototype.fields, fi = f.items, fl = f.length, v;


My json data is:



{ "id":"tramaJSON",
"type":"response",
"name":"CONSULTA_MONEDA",
"module":"ADP_PKG_COMUN",
"signature":"0.3229155",
"success":"True",
"results":2,
"metadata":{ "idProperty":"id",
"root":"rows",
"totalProperty":"results",
"successProperty":"success",
"fields":[ {"name":"CODIGO_MONEDA","mapping":"CODIGO_MONEDA","size":2,"header":"CODIGO_MONEDA"},
{"name":"DESCRIPC_MONEDA","mapping":"DESCRIPC_MONEDA","size":50,"header":"DESCRIPC_MONEDA"},
{"name":"SIGNO_MONEDA","mapping":"SIGNO_MONEDA","size":4,"header":"SIGNO_MONEDA"},
{"name":"ABREVIA_MONEDA","mapping":"ABREVIA_MONEDA","size":5,"header":"ABREVIA_MONEDA"}
]
},
"rows":[ {"CODIGO_MONEDA":"02","DESCRIPC_MONEDA":"DÓLARES AMERICANOS","SIGNO_MONEDA":"US$ ","ABREVIA_MONEDA":"USD "},
{"CODIGO_MONEDA":"01","DESCRIPC_MONEDA":"NUEVOS SOLES","SIGNO_MONEDA":"S/. ","ABREVIA_MONEDA":"SOL "}
]
}



Some idea ?, please help.

fay
13 Jan 2011, 12:03 PM
Just from a quick look at the "Automatic configuration using metaData" section in JsonReader (http://dev.sencha.com/deploy/dev/docs/?class=Ext.data.JsonReader), are you sure that your JSON is correct?

Remove the quotes from around "metadata", and, also, I think from "True" in "success":

randielCoder
13 Jan 2011, 12:47 PM
I try it, without quotes on metadata.
And "metadata" change for "metaData" with "D".

My json-lib for java generate all json with quotes.

Greetings and Thank you,