I have a store that read json string from .Net Server.
The problem is that the sencha app wrtire that their is no result (“emptyText”).
This store worked good with dummy data (data:[ ]) but when I try to read proxy I’m having a problem
The store code:
Ext.define('myApp.store.myStore', {
extend: 'Ext.data.Store',
alias: 'widget.myStore',
autoLoad: true,
config: {
model: 'myApp.model.myModel',
proxy: {
type: 'scripttag', //Also tried ajax and jsonp
url: 'http://localhost:XXXX/ServerResponse/ReponseT.aspx?CityID=1',
reader: {
type: 'json'
}
}
}
The Server Code (C#):
List<result> Li = new List<result>();
result LR = new result()
{
id = 1,
Title = "Heu There"
};
Li.Add(LR);
string ans = JsonConvert.SerializeObject(Li, Formatting.Indented);
Response.Write(ans);
I have a warning:
Resource interpreted as Script but transferred with MIME type text/html: “URL”
Thats it… I hope some one will be able to say what am I doing wrong
You need to specify the header type. This below code works for me to fetch JSON data from .Net server.