PDA

View Full Version : problem with json store in grid-> cant see data



c.kienzl@o-range.at
8 Apr 2010, 5:20 AM
hi all,

i try to use the extjs designer. up to this time i think its an grate toll. some kind of child isius, but its ok.

i build an json store and load some data via ajax to them. i matched this store with an grid. in the design vie i see all rows in the grid (all data).

when i klick on preview or i export the project, i didnt get the data. no data displayed in
the grid

has anyone a idea?

thx

aconran
8 Apr 2010, 9:23 AM
Are you loading the store by using the autoLoad configuration and/or explicly loading the store like:


Ext.StoreMgr.lookup('myStore').load();

ufologo22
8 Apr 2010, 9:53 AM
Hi c.kienzl@o-range.at,
I had the same problem but the solution was posted in the "bug" area of the forum.

Basically, once the project is exported it created a folder called "mockup". I had to move the file containing my data (txt or php or whatever you are using) inside "mockup". I also had to make sure my json store was autoloading. Then it should work.

c.kienzl@o-range.at
9 Apr 2010, 12:30 AM
ok, i found the problem

i copied my ext js script in the filedir of my php file. now it works!

other question how to handle an editable grid with the return values to php?

mihaip007
27 Apr 2010, 10:01 AM
okay, hmmm. This is strange. I have the same problem. However I linked the store to a url such as "http://localhost/mydata/mydata.html". The same problem applies here: I get to view ALL the date in the design mode, but when I preview it or export it - there is no data.

Why is that? I have tried to save the data file right next to the project file, but no success. What am I doing wrong? Oh and I ALSO have the autoload of the store on.

abe.elias
27 Apr 2010, 8:21 PM
@mihaip007 Can you share your XDS file? If not, what's the url property you have set on your Store? I assume you have a local webserver running. What is the URL path to the app? is it the root (http://localhost/) or in a sub dir (http://localhost/myapp/)?

This sounds like a path issue.

mihaip007
28 Apr 2010, 9:05 PM
Hi...!

Thanks for the quick reply. I have attached the xds file. I have created a json file with some data. It works in designer mode, but not in preview mode. That is the only issue.

I have noticed that it was complaining that the json file could not be loaded and it gave me the url it was using, so I simply placed the file in location where I can access it using the url http://localhost/dev/survey.html

Can you see what I am doing wrong?

wickedsheep
28 Apr 2010, 11:05 PM
Strange, I have the same problem. I've created the store with the designer and my store loads (I see my JSON data in Firebug), but grid shows only empty lines (" " values inside cells).

Edit: I've even checked my store, data is there, just not shown in my grid.

MyStore
- reader
-- jsonData
--- mydata
---- 0
---- 1
---- 2
...

abe.elias
29 Apr 2010, 1:44 AM
Hi...!

Thanks for the quick reply. I have attached the xds file. I have created a json file with some data. It works in designer mode, but not in preview mode. That is the only issue.

I have noticed that it was complaining that the json file could not be loaded and it gave me the url it was using, so I simply placed the file in location where I can access it using the url http://localhost/dev/survey.html

Can you see what I am doing wrong?

Try removing the "http://localhost/" from the url config on the store. Are you exporting to the root of your website (http://localhost/) or do you export to a sub directory?

mihaip007
29 Apr 2010, 1:53 AM
Hi...!
How do I know where it exports? Because I only click on the "preview" button. As about the "http://localhost/" part - yes I tried to remove it. Again it works in the designer, but not in the preview mode... very weird indeed hehehe.

wickedsheep
29 Apr 2010, 3:01 AM
I solved my problem, I messed up dataIndex fields.

mihaip007
29 Apr 2010, 4:29 AM
I am not sure what that means? Can you please elaborate?

abe.elias
29 Apr 2010, 9:29 AM
We are rethinking our approach to "Preview". Currently, preview uses ComponetMgr.create and is passed the JSON config of the component you are on. It doesn't add the stores into the "Preview".

mihaip007
29 Apr 2010, 11:38 AM
oh okay...! hmmm so should I just be a little more patient with a few features :) Great work so far. I just hope I get to use this tool in more depth for my future developments.

abe.elias
29 Apr 2010, 11:53 AM
oh okay...! hmmm so should I just be a little more patient with a few features :) Great work so far. I just hope I get to use this tool in more depth for my future developments.

Thanks for the feedback, keep the pressure on!

Capt.JackSparrow
4 May 2010, 6:54 AM
Me too facing a similar problem.
I am loading a grid with an autoloading store.
However, grid appears blank in preview and while trying to view via xds_index.html page.

The thing is I am able to load the store alone from the designer, if I right-click and load the store.

P.S: Attaching the xds file for ref.

mihaip007
4 May 2010, 7:35 AM
Okay - so from what I gathered from this forum is that one cannot do it...! You cannot create a grid and autoload in the preview! THAT is what I understood from this forum...!

I am dissapointed, but I suppose I have to have patience to wait for this feature to actually work, even though it seems they are re-thinking the road on the preview mode... hmmm Don't know where I am (my head is spinning)...

jarrednicholls
4 May 2010, 9:19 AM
Yes we are re-thinking how to (or more precisely, where to) load the Preview but still support pulling data from any URL location (i.e., support cross-domain XHR requests). Stay tuned :-) Thanks for the feedback.

mihaip007
4 May 2010, 9:52 AM
YEAY!!!!