Skip to content

Instantly share code, notes, and snippets.

@feedhenry-gists
Created June 14, 2011 11:36
Show Gist options
  • Save feedhenry-gists/1024737 to your computer and use it in GitHub Desktop.
Save feedhenry-gists/1024737 to your computer and use it in GitHub Desktop.
Tutorial Sencha Touch Fallback
// Get the latest view definition from server
$fh.act({act: 'getUI', req: {} }, function (res) {
// Returned object is our menu definition, so we can use it to initialise the menu, but lets save it locally first
$fh.data({
act: 'save',
key: 'menu_definition',
val: JSON.stringify(res)
});
// Use the retrieved view to initialise the app
...
}, function (code, errorprops, params) {
// If there's a problem getting defintion from server, fall back to a locally stored definition
$fh.data({
key: 'menu_definition'
}, function (data) {
// Use the retrieved view data to initialise the app
....
}, function () {
// No view available, drop back to view stored in client files
....
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment