ExtJS4 reader.read is not a function

        在初用者,ExtJS 中 is not a function 错误是比较常见的,xxx is not a function 含义很简单,就是xxx 你没有定义;或者你定义了,没有正确引用,无法找到。有的时候,还不是很好找到到底那里出错,这里以reader.read is not a function 为例,提供一种思路,希望能够带来一些启发。

Ext.define('Ext.data.proxy.Server', {//......

 // Should this be documented as protected method?
processResponse: function(success, operation, request, response, callback, scope){
	var me = this,
	reader,
	result;
	if (success === true) {
	     reader = me.getReader();
	     result = reader.read(me.extractResponseData(response)); 


上面 报错的行是:result = reader.read(me.extractResponseData(response)); 报错的类是proxy.Server 这个类在文档中是privte 提供内部用的,对外提供服务的是他的父类Ext.data.proxy.Proxy,这是ExtJs 比较有意思的。Proxy 主要用来绑定store ,这样基本可以判断大概的范围,我们store 里面配置是否正确,Model 对象是否正确……

Proxies are used by Stores to handle the loading and saving of Model data. Usually developers will not need to create or interact with proxies directly.



你可能感兴趣的:(ExtJS4 reader.read is not a function)