I am new to ext js. I am trying to pass a JSON in the request body to service call. I am using the following code to send JSON in the request. I getting an error response when i do so.
Ext.define('MyStore.store.dashboard.graphs.Temp', {
extend: 'Ext.data.Store',
proxy: {
type: 'ajax',
url: 'abc.php',
headers: {
'Content-Type': 'application/json'
},
params : JSON.stringify({
locationID: [],
startDtTime: "2009-06-10T11:00:00",
endDtTime: "2016-05-10T11:00:00",
GroupValue:"",
}) })
But when i use Ext.Ajax.request i get a proper response:
Ext.Ajax.request({
url: 'abc.php',
jsonData : data,
success: function(hxr) {
console.log(hxr);
},
failure: function(hxr) {
console.log(hxr);
}})
I have seen similar posts in the forums. My question is if there is no way to set json in a request using store then can i pass response obtained from Ext.Ajax.request to my store?
store.load({params:{}});