-
21 Mar 2013 10:03 AM #1
Architect 2.1 (278) Problem in loading XmlStore (extjs 4)
Architect 2.1 (278) Problem in loading XmlStore (extjs 4)
I am trying to load data from a URL into an XML store. When I click on the load data link I get an error indicating that it cannot load the data using the supplied configuration and offers a link. When I click on the link, the XML data is present. How do I get around this?
-
21 Mar 2013 2:49 PM #2
Please provide a sample of your XML response, the url you are pointing to in your proxy, your url prefix set in your project file and what your model/reader look like.
I'd guess that it is due to having your reader setup incorrectly, but without the above info i'm not sure.Aaron Conran
@aconran
Sencha Architect Development Team
-
22 Mar 2013 4:55 AM #3
Response
Response
<results>
<recordset>
<record>
<shortdescription>Not Available</shortdescription>
<longdescription>Not Available</longdescription>
<address>8662853594</address>
<routingstrategyid>1</routingstrategyid>
<routeplanid>21</routeplanid>
<groupid>0</groupid>
<entrypointid>18</entrypointid>
<language>en-US</language>
<entrypointtypecode>1</entrypointtypecode>
</record>
<record>
<shortdescription>Test Entry Point 1</shortdescription>
<longdescription/>
<address>8772348063</address>
<routingstrategyid>1</routingstrategyid>
<routeplanid>21</routeplanid>
<groupid>0</groupid>
<entrypointid>1</entrypointid>
<language>en-US</language>
<entrypointtypecode>1</entrypointtypecode>
</record>
<record>
<shortdescription>Test Entry Point 2</shortdescription>
<longdescription/>
<address>8772392609</address>
<routingstrategyid>1</routingstrategyid>
<routeplanid>21</routeplanid>
<groupid>0</groupid>
<entrypointid>2</entrypointid>
<language>en-US</language>
<entrypointtypecode>1</entrypointtypecode>
</record>
</recordset>
</results>
The URL is only located on my local machine at this point, and is dependent on an HttpHandler.
-
22 Mar 2013 5:08 AM #4
Reader and model
Reader and model
Ext.define('ExtJS_EntryPointGrid.store.EntryPtXmlStore', {
extend: 'Ext.data.Store',
requires: [
'ExtJS_EntryPointGrid.model.EntryPtModel'
],
constructor: function(cfg) {
var me = this;
cfg = cfg || {};
me.callParent([Ext.apply({
storeId: 'EntryPtXmlStore',
model: 'ExtJS_EntryPointGrid.model.EntryPtModel',
proxy: {
type: 'ajax',
withCredentials: true,
api: {
create: 'http://localhost:56349/ici.api/P_SNY9_DRCM_O/212',
read: 'http://localhost:56349/ici.api/P_SNY9_DRCM_O/211',
update: 'http://localhost:56349/ici.api/P_SNY9_DRCM_O/212',
destroy: 'http://localhost:56349/ici.api/P_SNY9_DRCM_O/213'
},
extraParams: {
Mappable: 1,
Enabled: 1,
ParentID: 0
},
noCache: false,
url: '',
reader: {
type: 'xml',
record: 'record'
}
}
}, cfg)]);
}
});
Model:
Ext.define('ExtJS_EntryPointGrid.model.EntryPtModel', {
extend: 'Ext.data.Model',
idProperty: 'address',
fields: [
{
name: 'shortdescription'
},
{
name: 'longdescription'
},
{
name: 'address'
},
{
name: 'entrypointid'
},
{
name: 'groupid'
},
{
name: 'routeplanid'
},
{
name: 'routingstrategyid'
},
{
name: 'language'
},
{
name: 'entrypointtypecode',
mapping: 'entrypointtypecode'
}
]
});
-
25 Mar 2013 12:19 PM #5
Aaron Conran
@aconran
Sencha Architect Development Team
-
27 Mar 2013 7:40 AM #6
-
28 Mar 2013 10:47 AM #7
I noticed you have full paths in your api config. You should just use relative paths and setup your url prefix.
Are you deploying your web app to the same server that the api lives on?
http://en.wikipedia.org/wiki/Same_origin_policyAaron Conran
@aconran
Sencha Architect Development Team
-
29 Mar 2013 4:10 AM #8
Unfortunately, I can't use the relative path because it does not forward the port number. The site is currently being debugged and the port number is essential for VS 2010. Yes, the app is being developed on the same machine as the web server.
-
29 Mar 2013 7:24 AM #9
This should work. You should be able to set your urlPrefix to http://localhost:56349/ and then use relative paths.Aaron Conran
@aconran
Sencha Architect Development Team
-
29 Mar 2013 7:44 AM #10
Where is the urlPrefix property? I can only find url, and setting it does not allow me to access the data that is supplied by my http handler.


Reply With Quote