View Full Version : [CLOSED] 3.1.1 Bug? Undocumented Ext.data.JsonReader dependency

18 Mar 2010, 11:31 AM
This bug is only encountered when you've bundled your own distribution (like me), and don't choose to include the pkgs/data-json.js package ... This was the case in my situation, since I'm using XMLReader instead...

The Ext.data.DataReader.js functionality has an undocumented dependence on the Ext.data.JsonReader class in (at least) the following function:

extractData : function(root, returnRecords) {
// A bit ugly this, too bad the Record's raw data couldn't be saved in a common property named "raw" or something.
var rawName = (this instanceof Ext.data.JsonReader) ? 'json' : 'node';
If you don't have the pkgs/data-json.js package defined, you'll crap out when defining the rawName variable, and it results in the operation failing silently (even with exception listeners)... making it a bit painful to find out what went wrong...

Short term workaround is to include the package even if you don't need it... Long term is probably to fix the code that has already been labeled as "ugly".

Jamie Avins
18 Mar 2010, 12:44 PM
The data package is scheduled for a major refactor to clean all of this up. In the meantime we'll need to update the documentation to reflect the dependency.