-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JSON.js support for managing connection to WL JSON Store. #13
Comments
Thx Andrew |
[From ChrisF note] Yesterday I added some functionality to assist in using the store in dojox/app based applications, where you would like to define the store in config.json. Now you can define an entry like so: "Note" : {
"type": "dworklight/store/JSON",
"observable": true,
"params": {
"collectionInitClass" : "commonapp/LocalStorage",
"collectionInitMethod" : "note"
}
} The addition of collectionInitClass and collectionInitMethod, allow you to tell the store which class and method to call to provide the JSONStore collection if one is not set the first time the store is used in the app. This means that you do not have to worry about manually setting the collection through store.set("collection",collection); |
@chrisfelix82 - On the init front. Couldn't we use 'features' test (has("worklight") to determine the WL version, and branch to a the proper init flow. I would actually put a stake in the ground and only support WL6 ++. As far as auth goes, maybe two different init's; one for basic and one for encrypted (that requires creds). Love the config settings. |
Chris - my take - I basically agree with Karl. I think it would be very helpful to have the support in there - if Worklight breaks it again, worst case, we just take it out. I also agree that I also wouldn't even bother with WL < 6.0 - that's the current version now, and I think practically everyone is using it for new development. The auth thing wasn't relevant for my recent PoC, so I didn't think about that, I have to admit. |
It would be a huge help if JSON.js could abstract away some of the mechanics of getting the WL JSON Store in the first place. WL.JSONStore.init() took me a long time to get working (the docs weren't clear that it was returning a Deferred), and I still can't get WL.JSON.get() to work at all (instead, I am using the value returning from init's Deferred, which contains handles to all the collections. Abstracting out this flaky bit (which also needs to be wrapped in an onDeviceReady callback) would be a real time-saver.
The text was updated successfully, but these errors were encountered: