Sencha example: retrieving data via a local text file rather than a json url proxy.
Hi,
I am dissecting the Sencha examples to learn how to access data and use it in a Sencha application. Specifically, I am looking at the O'Reilly example http://dev.sencha.com/deploy/touch/examples/oreilly/
My goal is to prevent having to go to a separate url and instead use a text file (or any file) on my local machine.
In the code availabe in the sample, the O'Reilly app
Code:
initComponent: function() {
this.list = new Ext.List({
grouped: true,
itemTpl: '<span class="name">{title}</span> <span class="secondary">{room}</span>',
loadingText: false,
store: new Ext.data.Store({
model: 'Proposal',
sorters: 'time',
proxy: {
type: 'scripttag',
url :'https://en.oreilly.com/web2010/public/mobile_app/all',
// url :'mydata.txt', <- this don't work
reader: {
type: 'json',
root: 'proposals'
}
},
listeners: {
load: { fn: this.initializeData, scope: this }
}
});
When I plug the url https://en.oreilly.com/web2010/public/mobile_app/all into my browser, I'm able to extract this information and save it as a text file. But when I try to access text file in my proxy-url with something like this:
Code:
proxy: {
type: 'scripttag',
url :'mydata.txt', //<- this don't work
reader: {
type: 'json',
root: 'proposals'
}
The Oreilly list doesn't get the data from the text file, and the Sencha app just hangs with no data to display. I'm wondering with anyone else has tried to access data without having to use an outside url proxy and just a local file. Let me know? thanks.
can we write and read excel file and text file in sencha touch ?
Hi everyone..
can we write and read excel file and text file in sencha touch 1 or 2?
If so we can get the data from Excel file and stores into database pragmatically, which makes easy to update database through excel file instead of modifying in DB and again installing application.
Note: I am talking about mobile application which is not web app
Thanks in advance..