extjs - Sencha nested json display in Dataview -


please me solve issue.. spending time sort out.. have json file want display in dataview.. can display parent values cannot getting child nodes

this json format

{     "items": [         {             "name": "science gallery",              "menu": [                 {                     "commenttext": "sc sandwich"                 },                 {                     "commenttext": "sc toasted sandwich"                 },                 {                     "commenttext": "sc panini"                 },                 {                     "commenttext": "sc ciabatta"                 },                 {                     "commenttext": "sc burrito"                 }             ]         }      ] } 

this view /** * touchcalendar.view.eventlistpanel */

ext.define('winreo.view.propertydetailsview', {     extend: 'ext.panel',      requires: [         'ext.dataview.list',         'ext.layout.fit'     ],      alias: 'widget.propertydetailsview',     id:'propertydetailsview',     config: {         // title   : 'events list',         layout  : 'fit',         store:'winreo.store.propertydetails',         id:'propertydetailsview',         cls:'propertydetailscss',       },      initialize: function(){          var listadd =  ext.create('ext.dataview', {             fullscreen: true,             id: 'listepieces',            //itemtpl:  listtemplate,            //data:[],            itemtpl: [                '{name}',                '<div>',                '<h2><b>menu</b></h2>',                '<tpl for="menu">',                '<div>{item}</div>',                '</tpl>',                '</div>'            ].join(''),             loadingtext: 'loading...',            store: storedetails            /*listeners:{                itemtap: function(record, index){                  alert('hi');                }            }*/          });         this.add(listadd);       }  }); 

here model

ext.define('winreo.model.propertydetailsmodel', {     extend: 'ext.data.model',    // requires: ['winreo.model.propertydetailsmodelcomments'],     config: {         fields: [              {name: 'name'},             {name: 'commenttext'},             {name: 'item'}           ]     }   }); 

here store

ext.define('winreo.store.propertydetails', {     extend: 'ext.data.store',     requires: [         'winreo.model.propertydetailsmodel',          'ext.data.store',         'ext.dataview.dataview',         'ext.data.nodestore',         'ext.data.treestore'     ],      config: {         storeid: 'propertydetails',         defaultrootproperty: 'items',         model: 'winreo.model.propertydetailsmodel',         autoload: true,           proxy: {              type: 'ajax',             method:'post',             url: 'resources/data/fullproperty.json',             //url: apiurl+'propertylist.ashx?switch=getpip&reoid=',              reader: {                 type: 'json',                 rootproperty: 'items'              }         }       }  }); 

can display nested json noram model, there model association needed?

please help...ur appreciated..thanks in advance

change proxy setting in store follows. removed 'rootproperty' , add 'record'

proxy: { type: 'ajax', method:'post', url: 'resources/data/fullproperty.json', //url: apiurl+'propertylist.ashx?switch=getpip&reoid=', reader: {     type: 'json',     record: 'items' } 

}


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -