Extjs Store DataModel Subfield Null Error -


when try load remotely data grid error subfields:

cannot read property 'id' of null 

my datamodel:

    ext.define('ruledatamodel', {         extend: 'ext.data.model',         fields: [            { name: 'id'},            { name: 'createtime', type:'date', dateformat: 'timestamp', convert:function(v,j){ return (v != null?new date(v):null);}},            { name: 'discountpercent'},            { name: 'discountamount'},            { name: 'discountoversalepriceflag', type: 'boolean'},            { name: 'minsalepricetotal'},            { name: 'maxcount'},            { name: 'execorder'},            { name: 'clearanceincludedflag', type: 'boolean'},            { name: 'relatedproductmincount'},            { name: 'promocoderuletypename', mapping: 'promocoderuletype.friendlytype'},            { name: 'groupname'},            { name: 'producttypeid', mapping: 'producttype.id', defaultvalue: ''},            { name: 'producttypename', mapping: 'producttype.name', defaultvalue: ''},            { name: 'relatedproducttypeid', mapping: 'relatedproducttype.id', defaultvalue: ''},            { name: 'relatedproducttypename', mapping: 'relatedproducttype.name', defaultvalue: ''}         ],          idproperty: 'id'     }); 

returned json data:

{totalcount: 1, root: [{"producttype": {"name": ... "relatedproducttype":null, ... "execorder":0,"id":11}]} 

check following things :

  1. check namespace of model. ruledatamodel or foo.bar.ruledatamodel?

  2. there might problem json. there simple way test if json correct or not. save json in .json file , open file in browser. if browser able open json file correctly json correct, otherwise not.


Comments

Popular posts from this blog

Delphi XE2 Indy10 udp client-server interchange using SendBuffer-ReceiveBuffer -

Qt ActiveX WMI QAxBase::dynamicCallHelper: ItemIndex(int): No such property in -

Enable autocomplete or intellisense in Atom editor for PHP -