5 Dec 2012 8:18 AM #1
Unanswered: Which proxy format to use if I want to store text styles in a file....
At the moment I have an iPad split view (left hand column 1/3 right hand column 2/3, like the kitchen sink app) where my list, thumbnail and main content comes from a JSON file. When I click on an item in the list, it populates the main panel on the right.
I realise that it is not possible to style the text inside the JSON file (I would like to have bold text for some words, underline etc) so I was wondering what would be the best proxy type to use?
Would it be better for me to use an XML proxy instead? Would this allow me to save style information inside, or does anyone have any other suggestions?
I was trying to avoid having separate HTML files for efficiency reasons...
5 Dec 2012 11:29 AM #2
The type of proxy wouldn't really matter here. If you want formatted text, you'll probably want to send a block of HTML in the response. You can stuff that into either a XML or JSON response...just make sure you encode it properly.
7 Dec 2012 6:52 AM #3
- Join Date
- Mar 2007
- Gainesville, FL
- Vote Rating
Also, you won't be able to save to a file using the data package. You would need a server side script for that or be within a packaged app and handle the saving to the file in your code.Mitchell Simoens @SenchaMitch
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 firstname.lastname@example.org
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.
7 Dec 2012 7:14 AM #4
Thanks both...this panel is a bit simpler in concept, just grabbing a local JSON file so there will be no saving to a file needed.
I'd like to be able to click on the presenter you would get nice formatted HTML content on the right, but I'm unsure about this, I would have thought perhaps I could store HTML in an XML file but not sure about the encoding and storing all the HTML tags etc inside the file. For example, if the content contains "black & white" would it show up as "black & white"? I'd like to be able to store other tags too like <h3> etc.