web services - ExtJS 4 consuming server response -


i'm working extjs4 in large legacy web application, , trying figure out how tie view particular sub-object inside store handles web services proxy. webservice provide object so:

foodorder = {   result: {          date : 02/11/2013,           orderid: 123456,            fruitproducts: {             melons: {                water,                cantelope,                ...             },             apples: {                delicious,                granny smith,                ...             }           }         }   } 

the store receiving response looks this:

ext.define('myapp.model.foodorder', {   extend: 'ext.model',    fields: [     {name: 'date', type: 'date'},     {name: 'orderid'},     {name: fruitproducts, type: 'array'}   ],    proxy: {     type: 'mycustomproxy',     url: 'the/food/store/order',     reader: {       root: 'result',       totalproperty: 'totalcount'     }   } }); 

what strategies can take "dig into" fruitproducts parameter inside result? if wanted load view information found in webservices response, how that? there way filter through response?

any ideas/thoughts appreciated.

the root config property on reader can changed refer deeper content. ext docs this root:

for json reader it's property name (or dot-separated list of property names if root nested).

so, should able use this:

reader: {     root: 'result.fruitproducts',     // etc... } 

Comments

Popular posts from this blog

curl - PHP fsockopen help required -

HTTP/1.0 407 Proxy Authentication Required PHP -

c# - Resource not found error -