webfriend13
5 Apr 2012, 2:59 AM
Hi all,
Please look at the following store:
var store = new Ext.create('Ext.data.ArrayStore', {
id: 'store',
autoLoad: false,
buffered: true,
pageSize: 50,
fields: resultFields,
remoteSort: true,
proxy: {
type: 'ajax',
url: '/url/results',
jsonData: jsonStr,
actionMethods: {
create: 'POST',
read: 'POST',
update: 'POST',
destroy: 'POST'
},
extraParams: {
userName: 'fid'
},
reader: {
root: 'data',
totalProperty: 'totalCount'
}
}
});
I am not able to "POST" the data using Extjs Store. I am able to see the extra params which i am sending but not the data I am trying to send using jsonData config. The same code works when i use Ext.Ajax.request.
Please note: I dont want to send data available in my store. I want to send data available in 'jsonStr' variable declared somewhere in my program
//with following code I am able to post data to server
Ext.Ajax.request({
url: '/url/results',
method: 'POST',
//Send the query as the message body
jsonData: jsonStr,
params: {
userName: 'fid'
}
});
Please provide your suggestions.
Please look at the following store:
var store = new Ext.create('Ext.data.ArrayStore', {
id: 'store',
autoLoad: false,
buffered: true,
pageSize: 50,
fields: resultFields,
remoteSort: true,
proxy: {
type: 'ajax',
url: '/url/results',
jsonData: jsonStr,
actionMethods: {
create: 'POST',
read: 'POST',
update: 'POST',
destroy: 'POST'
},
extraParams: {
userName: 'fid'
},
reader: {
root: 'data',
totalProperty: 'totalCount'
}
}
});
I am not able to "POST" the data using Extjs Store. I am able to see the extra params which i am sending but not the data I am trying to send using jsonData config. The same code works when i use Ext.Ajax.request.
Please note: I dont want to send data available in my store. I want to send data available in 'jsonStr' variable declared somewhere in my program
//with following code I am able to post data to server
Ext.Ajax.request({
url: '/url/results',
method: 'POST',
//Send the query as the message body
jsonData: jsonStr,
params: {
userName: 'fid'
}
});
Please provide your suggestions.