-
5 Feb 2013 8:13 AM #1
Direct store with API object not load data
Direct store with API object not load data
Hello,
In architect, if i configure the store reader with direct with directfn, or API, architect telle me an error on load datas : Unable to load data from the supplied directFn.
but in brower all work fine !
it's really hard to work, without datas !
-
5 Feb 2013 3:50 PM #2
Thanks for reporting your issue to us -- would you be able to provide us a bit more information about how to replicate the issue you're having, exactly?
We'll need to be able to recreate the issue on our end to better assist you.
Thanks!Steve Sobel
@honestbleeps
Sencha Architect Development Team
-
6 Feb 2013 2:20 AM #3
Hello,
My direct API is on a server ( not on the same domain ).
My apache headers are set for enable the cross domain :
Direct api send this datas :Code:Header set Access-Control-Allow-Origin "*" Header set Access-Control-Allow-Headers "X-Requested-With , Content-Type"
In architect, i can add the direct api ressource ( green mark appear )Code:Ext.ns('Ext.app'); Ext.app.REMOTING_API = {"url":"http:\/\/mydomain.local\/direct\/router","type":"remoting","actions":{"Users":[{"name":"getUsers","len":1}]},"namespace":"Ext.app"};
Now i create a Direct Store ( in project inspector )
I change the autoLoad property to TRUE,
I change the reader property "root" and setting to "datas" default is blank.
Now i configure the Proxy "directfn" property with the combo menu, and choose " Ext.app.Users.getUsers"
I i click to "load data", i have an error : "Unable to load data from the supplied directFn."
But if i preview the project in brower, the datas are loaded in the store.
this is a sample server response for the direct method :
now if i modify my store proxy, and remove directfn, for add api object ( CRUD config )Code:{ "type": "rpc", "tid": 1, "action": "Users", "method": "getUsers", "result": { "datas": [{ "id": "1", "username": "User 1", "email": "email@domain.com", "phone": "", "company": "", "activated": "1", "created": "2013-02-05 18:27:46", "modified": "2013-02-05 18:27:46", "last_login": "2013-02-05 09:55:05", "last_service": null, "email_validation": "1", "creator": "0", "last_ip": "192.168.0.10", "banned": "0", "ban_reason": null }, { "id": "3", "username": "test", "email": "test@domain.com", "phone": null, "company": null, "activated": "1", "created": "2012-05-24 09:24:08", "modified": "2013-02-05 09:46:49", "last_login": "2013-02-05 08:46:49", "last_service": null, "email_validation": "0", "creator": "0", "last_ip": "192.168.0.10", "banned": "0", "ban_reason": null }, { "id": "30", "username": "me", "email": "me@domain.com", "phone": null, "company": null, "activated": "0", "created": "2012-05-24 15:03:46", "modified": "2012-05-24 15:03:46", "last_login": null, "last_service": null, "email_validation": "0", "creator": "0", "last_ip": "127.0.0.1", "banned": "0", "ban_reason": null }, { "id": "35", "username": "testuser", "email": "test.user@domain.com", "phone": null, "company": null, "activated": "1", "created": "2012-05-24 15:31:30", "modified": "2012-05-24 15:41:03", "last_login": null, "last_service": null, "email_validation": "0", "creator": "0", "last_ip": "127.0.0.1", "banned": "0", "ban_reason": null }] } }
the "load datas" menu is disabled, but in preview mode, all work fine !
-
6 Feb 2013 4:47 AM #4
hello,
i have change my server code from this post : http://www.sencha.com/forum/showthre...or-CodeIgniter
to the code from this : https://bitbucket.org/mikebranderhor...rect/wiki/Home
and now in the architect, when i select the directfn, architect write the link to the method like this :
with the previous server code, architect write the method like this :Code:Users.getUsers
now, directfn work, but api not.Code:Ext.app.Users.getUsers
Thank you for reporting this bug. We will make it our priority to review this report.


Reply With Quote