ExtJS4: Why, when I use the directFn configuration in my store, I need to specify directCfg.method as a directFn property

I recently used the directFn configuration as follows:

var store = new Ext.data.Store({
    proxy: {
        type: 'direct',
        directFn: myDirectfn,
...

But this will not work, because ExtJS has thrown an exception

Uncaught TypeError: Unable to read undefined property method

on the lines

method = fn.directCfg.method;
if (method.ordered) {

in the file path/to/ext/src/data/proxy/Direct.js. After some digging, I found that it fnrelates to a function myDirectfn. So I added the lines:

myDirectfn.directCfg = {
    method: {}
};

in my code. After that, everyone began to work normally ( Here is the violin ).

So the question is, what kind of magic is this directCfg? Why is this necessary?

+5
source share
2

, directFn . directFn Ext.direct.RemotingProvider. .

+2

Ext.app.REMOTING_API , . , api TestAction, :

Ext.ns("Ext.app"); 
Ext.app.REMOTING_API = {"url":"php\/router.php","type":"remoting","actions":{"TestAction":[{"name":"doEcho","len":1},{"name":"multiply","len":1},{"name":"getTree","len":1},{"name":"getGrid","len":1},{"name":"showDetails","params":["firstName","lastName","age"]}],"Profile":[{"name":"getBasicInfo","len":2},{"name":"getPhoneInfo","len":1},{"name":"getLocationInfo","len":1},{"name":"updateBasicInfo","len":0,"formHandler":true}]}};

Ext.app.REMOTING_API, .

+1

All Articles