-
23 Mar 2010 10:00 PM #1
Local data store
Local data store
I'm a little unclear on exactly what the data stores in the Designer support.
Is it possible to specify not only the definition but also the data that gets read in for data stores within the designer? Or perhaps point to a file on the local filesystem? Hitting a url is fine in many situations, but often for prototyping it seems that it would be more convenient to have a standard set of test data available locally (the services might not be written yet, server not available, etc).
-
24 Mar 2010 5:24 AM #2
I am not sure if the "file://" protocol works, but why not set up an apache webserver, or whatever (webrick, lighttpd, iis etc) you would like on your machine, that just points to your test data? For instance, I use OS X, so it's easy for developers to just use their "~/Sites" directory to store plain text files containing javascript/json test data. This way you still work via HTTP and it truly simulates what you are trying to do.
-
24 Mar 2010 9:41 AM #3
I cannot get the stores to work,
I have tried:
- Add Json Store
- Entered the url (I checked via typing in Firefox and can see the data) in this case I have used a Http location
- added the root
right clicked on MyStore and Load Data:
An Error has occured on line 7 in the designer-complete.js
TypeError: Result of expression 'this.owner' [undefned] is not an object.
Is this not the correct method?
Thanks
-
24 Mar 2010 9:55 AM #4
I had the problem this morning. The url you enter is supposed to be relative to a base url. I found this (annoying) setting in the "Edit->Edit Preferences" menu. Here lies the "URL Prefix". Set your prefix ("http://localhost" or whatever) in this field, then your data store url is just something like "/somepath/to/a/json/result".
I also noticed that the right click "Load Data" option is broken (throws an error). Select the datastore and click the "load data" button above.
I am still trying to figure out how to get the grid to display the data. I believe I have it configured correctly, but no luck.
Error messaging and reporting needs a lot of improvement. That annoying dialog that says something like "cannot load data with current configuration" is bad. A nice 404 with the darned URL it tried to hit would be nice. I would have noticed "http://localhosthttp://localhost/testdata.js" as being an issue.
-
24 Mar 2010 10:13 AM #5
-
24 Mar 2010 10:32 AM #6
Just to make sure:
Here is a quick json data example:
{
"Example": [
{"id":1, "val":"1"},
{"id":2, "val":"3"},
{"id":3, "val":"1"},
{"id":4, "val":"1"},
{"id":5, "val":"1"}
]
}
Save that to a file named "example.js" and make it accessible within your http server.
So, assuming you have it @ http://localhost/example.js
Make sure your base url prefix (in the edit->edit preferences) is http://localhost/
Create your datastore and set the following properties:
root: Example
storeId: Example //not required for our test, but...
url: /example.js
Then click on the load data button
Does it work? Are you sure you have the correct url? Are you missing a path component such as http://localhost/<~your home dir>/path ?
Other than that, I am not sure. I'm not having a lot of luck on this application. What OS are you using?
-
24 Mar 2010 11:02 AM #7
Getting it to work
Getting it to work
So far Im trying right now to replicate an already built app. At this moment everything is new and unknown ... Well ... mostly.
The designer is doing a lot of weird things while working with it ... Im still supposing that these is due to the trial version (even it says its a fully working version )
In regards to the store I have already made it to connect
my edit preferences -> base url is: http://localhost/myAppName/
In my stores im using: url: 'datastores/storename.php' where stores is the subfolder within myAppName.
It works, it loads the data (at least thats what it says) but still cant see it with the preview (binded to a GridPanel)
I will keep going with testing to see how well this new tool performs.
Best of luck to each of us!!! We'll keep posting info as it becomes available.
Regards,
Ernesto Vallejo.Kind regards,
Ernesto Vallejo.
-
24 Mar 2010 11:21 AM #8
-
24 Mar 2010 3:44 PM #9
Sure, that makes sense I'm fine with setting something like that up. I'm just thinking ahead to when I recommend other people in my organization try it out. A business analyst type might not be as comfortable with this but could still be effective with the Designer... at the least I might have to help set it up on their machines.
This works, but I'd still like to see more capabilities for dealing with data inside the Designer itself. Maybe a future version could come with an embedded server and give you the option of using that if you want.
-
24 Mar 2010 9:23 PM #10
I managed to make it work and to display the data in the grid within the designer. However this works only the 1st time, example:
I create new store and add the fields, then I click load and it shows me how many records are loaded. Then on the grid I am adding the corresponding dataIndex-es and the data appearing in the grid.
However if I close the project and then reopen it to continue working... the attempt to load the store is failing and the line 7 error is appearing.
adding new store and reconfiguring it again solve the problem but only until the next time you open the project.


Reply With Quote
