PDA

View Full Version : Question on using Params in Architect Store



robzdoom
6 Sep 2017, 8:33 AM
I am mainly using Sencha Architect. That is why I post most of my questions here.

When I create a store through Sencha Architect, I don't see the option to add params within the store
I am currently using Classic Toolkit.

This is what I currently have at this time. I am not sure If I am suppose to use extraParam, but this is what I have so far.



Ext.define('StoreReports.store.MyJsonStore', {
extend: 'Ext.data.Store',


requires: [
'Ext.data.proxy.Ajax',
'Ext.data.reader.Json'
],


constructor: function(cfg) {
var me = this;
cfg = cfg || {};
me.callParent([Ext.apply({
storeId: 'MyJsonStore',
proxy: {
type: 'ajax',
extraParams: {
StoreName: 'MAINTSTORE',
Detail: 'R',
ShowFdl: 'G98FGT',
Stop1: '10/12/1970',
Stop2: '10/10/1970',
Target: 'RES'
},
url: '[URL]',
headers: {
'TMS-Report': 'SystemReport:SystemReport',
//'Content-Type':'application/json; charset=utf-8'
},
reader: {
type: 'json'
}
}
}, cfg)]);
}
});


Once I make this call, I should be able to see this data, but instead when I try to load the data i get a 405 METHOD NOT ALLOWED. What should be my best approach with this issue? Eventually this data will populate a grid with button push.

Thanks so much for the help in advance. I've gotten much help from community and really appreciate it!

some more info. To give you a better idea, i've gotten this to work. This will log the information I am looking for.


Ext.create('Ext.Button', { text: 'Click me',
renderTo: Ext.getBody(),
handler: function() {

Ext.Ajax.request({
url: '[URL]',

method: 'POST',
dataType: "json",
params: {
StoreName: 'MAINTSTORE',
Detail: 'R',
ShowFdl: 'G98FGT',
Stop1: '10/12/1970',
Stop2: '10/10/1970',
Target: 'RES' },
headers: {
'TMS-Report': 'SystemReport:SystemReport',
//'Content-Type':'application/json; charset=utf-8' },


success: function(response, opts) {
var obj = Ext.decode(response.responseText);
console.dir(obj);
},


failure: function(response, opts) {
console.log('server-side failure with status code ' + response.status);
}
});
}
});