29 Oct 2012 6:15 AM #1
[4.1.3] Missing dependencies for Ext.data.Model
Ext version tested:
- Ext 4.1.0
- Ext 4.1.2
- Ext 4.1.3
Browser versions tested against:
- Firefox 16
- Creating an instance of a class that derives from Ext.data.Model requires both 'Ext.data.reader.Json' and 'Ext.data.writer.Json' by default (as they are the default reader and writer) but these are not required by Ext.data.Model.
Steps to reproduce the problem:
- Create an instance of a class that inherits from Ext.data.Model without first loading the JSON reader or writer classes
The result that was expected:
- The reader and writer classes are in the list of dependencies for Ext.data.Model
The result that occurs instead:
- The reader and writer classes are not in the list of dependencies and Ext.Loader attempts to synchronously load them. This doesn't work when synchronous loading is disabled.
The following just creates a grid property model (just as a class that inherits from Ext.data.Model). Nothing to see except the warning messages in the console.
Debugging already done:
- It looks like this has been a problem prior to 4.1.3 but have only noticed it on upgrading to 4.1.3 so possibly another class was loading the reader and writer previously...
- Get the following warning in the console (and an equivalent one for the writer):
[Ext.Loader] Synchronously loading 'Ext.data.reader.Json'; consider adding Ext.require('Ext.data.reader.Json') above Ext.onReady
- Add reader and writer classes to list of dependencies for Ext.data.Model
29 Oct 2012 2:44 PM #2
- Join Date
- Mar 2007
- Gainesville, FL
- Vote Rating
The model shouldn't require it, the proxy should. The reader/writer isn't used on the model, it's used on the proxy.Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Software Engineer
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services firstname.lastname@example.org
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!
When posting code, please use BBCode's CODE tags.
30 Oct 2012 12:43 AM #3
Fair point. Can the proxy require the reader/writer then please?
21 May 2013 12:38 AM #4
This is now fine in 22.214.171.1244Product Architect