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 :
check namespace of model.
ruledatamodel
orfoo.bar.ruledatamodel
?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
Post a Comment