PDA

View Full Version : ext.direct errors



alexliyu2012
5 Mar 2012, 10:30 AM
why the ext.direct error

the error is like Uncaught TypeError: Cannot read property 'submit' of undefined
my code is :

Ext.define('E2system.CmsCategoriesAdmin.EditForm', {
extend :'Ext.form.Panel',
border : false,
bodyPadding : 10,
api : {
submit : django.forms_CategoryForm.submit
},
paramOrder : ['id'],
defaultType : 'textfield',
fieldDefaults : {
msgTarget : 'side',
labelAlign : 'left',
labelWidth : 90,
anchor : '100%'
},
.......

Strangely enough, only the server restart, first visited the page will appear such a mistake,but not after refresh a few times, this is why?

mitchellsimoens
5 Mar 2012, 10:48 AM
You have a racing condition. When the Ext.define is executed, your provider hasn't returned so that function isn't going to be defined.

predator
5 Mar 2012, 5:03 PM
why the ext.direct error



the error is like Uncaught TypeError: Cannot read property 'submit' of undefined
my code is :

Ext.define('E2system.CmsCategoriesAdmin.EditForm', {
extend :'Ext.form.Panel',
border : false,
bodyPadding : 10,
api : {
submit : django.forms_CategoryForm.submit
},
paramOrder : ['id'],
defaultType : 'textfield',
fieldDefaults : {
msgTarget : 'side',
labelAlign : 'left',
labelWidth : 90,
anchor : '100%'
},
.......

Strangely enough, only the server restart, first visited the page will appear such a mistake,but not after refresh a few times, this is why?


Say again?!