PDA

View Full Version : unable to get output for data from webservice



chsrinivasgupta
5 Sep 2012, 4:47 AM
hi,

I want to display all empnames into list view in sencha touch. My table contains empid and empname.

the following is my js code. But i am unable to get output. Please help me. Thanks in advance.

My web service is returning output in json format. I converted o/p into json format


Ext.data.JsonStore({
proxy: new Ext.data.HttpProxy({
url: 'http://localhost:58984/Service1.asmx/GetListData' // werservicename.asmx/webMethodName
, headers: {
'content-type': 'application/json'
}
})
, root: 'd'
, idProperty: 'empid' // provide the unique id of the row
, fields: [empname] // specify the array of fields
});
itemTpl: '{empname}'

i am getting 2 errors. Errors are
Uncaught ReferenceError: empname is not defined app/view/Main.js?_dc=1346848551786:11 (file:///E:/Mobile/app/view/Main.js?_dc=1346848551786)
Uncaught Error: The following classes are not declared even if their files have been loaded: 'Acsellerate.view.Main'. Please check the source code of their corresponding files for possible typos: 'app/view/Main.js

scottmartin
5 Sep 2012, 2:56 PM
Uncaught ReferenceError: empname is not defined

fields: ['empname']

You need to add quotes around the field name(s)

Scott.

chsrinivasgupta
5 Sep 2012, 10:08 PM
Please give me the solution for below 2nd error

The following classes are not declared even if their files have been loaded: 'Acsellerate.view.Main'. Please check the source code of their corresponding files for possible typos: 'app/view/Main.js

scottmartin
6 Sep 2012, 4:14 AM
IT mean you list likely have a typo somewhere. You asking for something not loaded.
Is this spelled as expected: 'Acsellerate' ? Check each location.

Scott.

chsrinivasgupta
6 Sep 2012, 4:22 AM
in c:\inetpub\wwwroot i have a folder called mobile and in mobile
service1.asmx and service1.asmx.cs are saved. And sample.html file is also saved. In Sample.html file i am calling
app.js. In app.js i am calling Ascellerate.view.Main.js in which the below code is saved
Ext.data.JsonStore({
proxy: new Ext.data.HttpProxy({
url: 'http://localhost/mobile/Service1.asmx/GetListData' // werservicename.asmx/webMethodName
, headers: {
'content-type': 'application/json'
}
})
, root: 'd'
, idProperty: 'empid' // provide the unique id of the row
, fields: [empname] // specify the array of fields
});

itemTpl: '{empname}'

When I try to browse in google chrome it is giving error. Please let me know whether i am right or wrong.
Thanks in advance