-
27 Jul 2011 2:15 AM #1
Undefined parentPrototype when inheriting a store
Undefined parentPrototype when inheriting a store
Hi all,
I'm trying to inherit an Ext.data.Store, and I keep getting an error that
parentPrototype is undefined
parentStatics = parentPrototype.$inheritableStatics;
in ext-dev.js line 5713
(All references are autoloaded perfectly and they exist afaik)
The reason I want to inherit a store is to create a base store with all my default properties, like a common proxi api setting based on the model name:Code:Ext.require('Ext.data.Store'); Ext.require('Ext.data.Request'); Ext.ns('Lk.store'); Ext.define('Lk.store.SchoolGroupStore', { extend : 'Ext.data.Store', singleton : false, requires : ['Lk.model.SchoolGroup'], model : 'Lk.model.SchoolGroup', autoLoad: true, proxy: { type: 'ajax', url : '/backoffice/schoolgroup/listEntity', reader: { type : 'json', root : 'rows', totalProperty : 'rowCount', successProperty: 'success' } }, constructor : function() { this.callParent(arguments); } }); Ext.define('Lk.store.SchoolGroupStore2', { extend : 'Lk.store.SchoolGroupStore', singleton : true, requires : ['Lk.model.SchoolGroup'], model : 'Lk.model.SchoolGroup', autoLoad : true, remoteFilter: true, proxy: { type: 'ajax', url : '/backoffice/schoolgroup/listEntity', reader: { type : 'json', root : 'rows', totalProperty : 'rowCount', successProperty: 'success' } }, constructor : function() { this.callParent(arguments); } });
Am I doing something wrong or overlooking something?Code:Ext.ns('Twensoc.data'); Ext.define('Twensoc.data.BaseStore', { extend : 'Ext.data.Store', requires : ['Ext.data.Store'], singleton : false, autoLoad: false, remoteFilter: true, model : 'Lk.model.SchoolGroup' , proxy: { type: 'ajax', url: 'undefined', reader: { type : 'json', root : 'rows', totalProperty : 'rowCount', successProperty: 'success' } }, constructor : function() { var prefix = this.prefix; // derive the proxy api url's based on the modelname var modelName = this.model.split("."); modelName = modelName[modelName.length-1]; this.proxy.api = { read : prefix + modelName+'/listEntity', create : prefix + modelName+'/createEntity', update : prefix + modelName+'/saveEntity', destroy : prefix + modelName+'/deleteEntity' }; this.callParent(arguments); } } });
RonaldoRonald van Raaphorst aka Ronaldo
I'm a freelance software developer in Java, PHP, and ExtJs.
Skyperonald_twensoc
Mailinfo@twensoc.nl
Thank you for reporting this bug. We will make it our priority to review this report.


Reply With Quote