-
17 Oct 2009 12:24 PM #1
[SOLVED] DirectStore - items not loaded
[SOLVED] DirectStore - items not loaded
Hi, I spent lot of hours reading tutorials and forum posts, but I still cant solve my problem...
Direct call Stereotype.get returns this json:Code:Ext.onReady(function() { Ext.Direct.addProvider(Ext.Geek.DirectAPI); var store = new Ext.data.DirectStore( { directFn: Stereotype.get, fields: [ 'id', 'aa', 'bb' ], root: 'result.rows', idProperty: 'id', totalProperty: 'total', paramsAsHash: false }); store.load({callback: function(){alert('sss');}}); Ext.testingStore = store;
After execution, I can see the request in the firebug, it looks right...Code:{"result":{"rows":[{"id":1,"aa":"aaa","bb":"bbb"},{"id":2,"aa":"xxx","bb":"zzz"}],"total":2,"success":true,"status":true},"type":"rpc","tid":2,"action":"Stereotype","method":"get"}
But when I use this store for grid, grid is empty...
The alert in callback is also not executed.
When I try >> console.log(Ext.testingStore.data.items); its empty !!!
Maybe Im missing something... But I cant find it out...
Thanks a lot for advice..
V.Last edited by vojta.jina; 21 Oct 2009 at 10:08 AM. Reason: adding solved
-
18 Oct 2009 5:12 AM #2
What does your
Code:Ext.Geek.DirectAPI
look like?
-
18 Oct 2009 9:02 AM #3
Here is content of direct-api.js, very simple:
Im using Ext 3.0 from svn: http://extjs-public.googlecode.com/s...js-3.0/releaseCode:Ext.Geek.DirectAPI = { "url":"\/admin.php\/direct", "type":"remoting", "actions": { "Stereotype": [{"name": "get", "len": 0}] } };
-
18 Oct 2009 9:07 AM #4
Try to set len to "1" - are you still working with Ext 3.0.0?
-
18 Oct 2009 10:23 AM #5
I know about some problem with len:0 (Im using Ext 3.0.0), but when I set len to 1, nothing happens... Still the same...
But also no errors...
Btw, is possible to get 3.0.1 using svn ?
-
18 Oct 2009 10:27 AM #6
Sure if you have SVN access you can update your working copy to the latest HEAD revision.
-
18 Oct 2009 10:57 AM #7
I have only found svn on google - as I wrote, Im using http://extjs-public.googlecode.com/s...js-3.0/release.
There is no 3.0.1 version. I cant download 3.0.1 patch from the web, Im not registered user (Im just testing ExtJS, so I dont have the commercial version)
But this problem with DirectStore makes me crazy. No errors, no warnings, but items[] is empty... Nothing loaded...
-
18 Oct 2009 11:02 AM #8
-
18 Oct 2009 11:10 AM #9
Hmm, but I downloaded pmea (http://www.jbruni.com.br/pmea/), its not finished app, but it works and its also using DirectStore... On my local, it works with the same ext library (3.0.0), as the code above (my problem code) uses...
I want to use Direct, is pretty nice, I hope I did some mistake, but I cant find it :-D
-
21 Oct 2009 10:06 AM #10
Solved ! The problem was in bad $len parameter in Direct API !
I had len: 1 and len: 0 tested, but DirectStore add 2 params: sort, dir (when remote sorting is true).
Is there any possibility how to debug these things ? Its very difficult to find out bugs like that... No error in Firebug. Im using ext-debug, but it says nothing...


Reply With Quote
