With Lebowski, you are not restricted to just accessing views within
your SproutCore app. You can access any SproutCore object:
controllers, model objects, data stores, etc. Therefore, when
accessing records from a remote source, you can, for instance, use a
record or record array's status property to check if data has been
returned from the server. If the status is SC.Record.BUSY then you
continue to wait. Example:
App.wait_until do |app|
return app['path.to.record.status'] == app['$SC.Record.READY']
end
Above we use wait_until to keep checking a record object's status
property and determine if it is equal to the READY constant and if so
continue. Note the use of $SC which means to use SC and the root
object instead of the app's root object, such as 'MyApp'.
If you're not making use of record objects returned from the data
store to check their status, you can instead setup properties on a
controller that indicates the loading of data. When a callback is
fired by the datastore that causes the controller's property to
change, then that is confirmation that data came back. Example:
App.wait_until do |app|
return app['someController.isFooDataLoaded']
end
So long as isFooDataLoaded is false you will remain in the wait_until
block until a timeout occurs.
Given the two options, the more preferred approach is to leverage a
record's status property.
Regarding the long response times you're getting using Lebowski,
unfortunately I'm not sure why that would be happening.
-Mike