3 Feb 2012 8:09 AM #1
Easiest way to load external html content into a view
I'm using Sencha Touch 2 pr4. I have a number of views that will need to be just plain, static html. They won't have any controls, interactivity, etc. I have been attempting to load these into a ext.panel, thinking that there is a method in the panel class to do this, like 'loadContent' or something like that, but I haven't found one yet. Does an easy method exist for that? I've seen posts involving creating functions to load the content via ajax, but seems like a lot of people would need just plain html views like I do.
Also, if not with a panel, is there a way to define a view that is just plain html, not using a panel?
Sorry if this is an obvious question; I'm still a bit of a noob.
3 Feb 2012 8:22 AM #2
- Join Date
- Mar 2007
- Gainesville, FL
- Vote Rating
You should be able to do an Ajax request if it is same domainMitchell Simoens @LikelyMitch
Sencha Inc, Senior Software Engineer
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services email@example.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!
When posting code, please use BBCode's CODE tags.
3 Feb 2012 8:42 AM #3
Thanks. So is that the only way to accomplish it? I'm probably going to be having a lot of these types of views in the future, so I want to figure out the cleanest way to do it.
Is there a way that html content from a URL can be it's own view, or does a view have to descend from a container, panel, etc. ?