for need of simple demonstrator, i've created simple grid panel in extjs, , i'm trying fill data coming mongodb. heard node.js , stuff there want use rest api of mongodb retrieve data. note : i'm new in extjs , rest request.
my problem when loading page, there no panel created , firebug tells me : ""networkerror: 400 bad request - http://xxx.xxx.xx.xx:28017/mydb/device/find?_dc=1374225874880&page=1&start=0&limit=25""
if copy , paste url http://xxx.xxx.xx.xx:28017/mydb/device/find?_dc=1374225874880&page=1&start=0&limit=25 can see data, means mongo data accessible through url. note dont' know "page=1&start=0&limit=25" param of url comes from, wasn't implemented me.
my code supposed load data in store component of mvc :
ext.define('am.store.users', { extend: 'ext.data.store', model: 'am.model.user', autoload: true, proxy: { type: 'rest', url: 'http://xxx.xxx.xx.xx:28017/mydb/device/find', reader: { type: 'json', root: 'rows', idproperty: '_id' } } }); and shows mongo url :
{ "offset" : 0, "rows": [ { "_id" : "sheevaplug", "manufacturer" : "globalscale" } ], "total_rows" : 1 , "query" : {} , "millis" : 0 } the mapping in model seems correct :
ext.define('am.model.user', { extend: 'ext.data.model', fields: ['_id', 'manufacturer'] }); thanks advance if can me ! cheers,
vincent
use node.js create mongodb web services call sencha.
Comments
Post a Comment