0

I wanted to post the answer I found to the error I was getting

Uncaught TypeError: Object #<Object> has no method 'read'

Hopefully it will save some people a few hours of headache.


Your object searchn contains no values. I know that because the result of head(searchn) is:

factor(0)

which means you have a factor of length zero, i.e. it's empty.

Although the object is empty, it still contains meta-information about the factor levels, for example. So printing this meta-information should work without a problem. For example, try:

cat(levels(searchn), file="output.txt")
4

1 回答 1

1

I traced the code and got to a point where Ext was trying to call the proxies reader.read method. But for whatever reason the reader was not being created. I searched around online and found that there's some bug in Ext. At least that seemed to be the consensus.

What seemed to solve other's problem and my problem was to either include the models using script tags before creating the stores. Or using Ext.require( your models ) before creating the stores.

Hope this helps!

===Update=== line 40866 in ext-all-debug.js

        if (me.lastFieldGeneration !== **me.model**.prototype.fields.generation) {
            me.buildExtractors(true);
        }

This is the line that blows up if a model isn't set or undefined. Not sure if it has anything to do with the above error, but this is where ext crashed for me with no errors when my model wasn't loading correctly. This is seems like poor coding to me, referencing something without checking if it's defined or not.

于 2012-08-21T16:10:08.770 回答