Created
June 14, 2011 11:36
-
-
Save feedhenry-gists/1024737 to your computer and use it in GitHub Desktop.
Tutorial Sencha Touch Fallback
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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