问题描述
最近我正在使用像这样的 directFn 配置:
var store = new Ext.data.Store({代理人: {类型:'直接',directFn: myDirectfn,...
但是它不起作用,因为 ExtJS 抛出了异常
未捕获的类型错误:无法读取未定义的属性方法"
线
method = fn.directCfg.method;如果(方法.有序){
在文件 path/to/ext/src/data/proxy/Direct.js
中.经过一番挖掘,我发现 fn
指的是 myDirectfn
函数.所以我刚刚添加了几行:
myDirectfn.directCfg = {方法: {}};
在我的代码中.之后,一切都开始正常工作(这里是小提琴).
那么问题来了:这个directCfg
是什么神奇的东西?为什么需要它?
我认为您使用 directFn
不当.directFn
必须与 Ext.direct.RemotingProvider
.查看官方示例.>
Recently I was using directFn config like this:
var store = new Ext.data.Store({
proxy: {
type: 'direct',
directFn: myDirectfn,
...
But it wouldn't work because ExtJS threw exception
at the lines
method = fn.directCfg.method;
if (method.ordered) {
in file path/to/ext/src/data/proxy/Direct.js
. After some digging I've found out that fn
refers to myDirectfn
function. So I've just added lines:
myDirectfn.directCfg = {
method: {}
};
in my code. After that all started to work properly (Here is fiddle).
So the question is: What kind of magical thing is this directCfg
? Why is it needed?
I think you are using directFn
inappropriately. directFn
has to be used in tandem with Ext.direct.RemotingProvider
. Check out official example.
这篇关于ExtJS4:为什么当我在我的商店中使用 directFn 配置时,我需要将 directCfg.method 指定为 directFn 的属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!