cassiopeia
15 Oct 2012, 6:15 AM
Hi,
I need to create new records in the SAP database.
Reading is no problem, but I don't know which code i need to perform a POST operation.
I work with MVC.
My store is currently :
Ext.define('LeaveRequest.store.MyRequestsStore', {
extend : 'Ext.data.Store',
requires : ['LeaveRequest.proxy.oData', 'Ext.data.reader.Xml',
'Ext.data.writer.Xml'],
config : {
storeId : 'myrequestsstore',
model : 'LeaveRequest.model.Request',
proxy : {
headers : 'X-CSRF-Token : ... ; '
+ 'Content-Type : application/atom+xml ; '
+ 'X-Requested-With : XMLHttpRequest',
type : 'odata',
enablePagingParams : true,
withCredentials : true,
username : LeaveRequest.util.Config.getUsername(),
password : LeaveRequest.util.Config.getPassword(),
url : ' ... ',
reader : {
type : 'xml',
record : 'properties'
}
}
},
loadAll : function() {
var proxy = this.getProxy();
proxy.setExtraParams('');
this.load();
},
createEntry : function ( ... ) { ... }
});
I would like to make a new function 'createEntry' which receives the necessary parameters.
But what do I have to write in this method?
Thank you
I need to create new records in the SAP database.
Reading is no problem, but I don't know which code i need to perform a POST operation.
I work with MVC.
My store is currently :
Ext.define('LeaveRequest.store.MyRequestsStore', {
extend : 'Ext.data.Store',
requires : ['LeaveRequest.proxy.oData', 'Ext.data.reader.Xml',
'Ext.data.writer.Xml'],
config : {
storeId : 'myrequestsstore',
model : 'LeaveRequest.model.Request',
proxy : {
headers : 'X-CSRF-Token : ... ; '
+ 'Content-Type : application/atom+xml ; '
+ 'X-Requested-With : XMLHttpRequest',
type : 'odata',
enablePagingParams : true,
withCredentials : true,
username : LeaveRequest.util.Config.getUsername(),
password : LeaveRequest.util.Config.getPassword(),
url : ' ... ',
reader : {
type : 'xml',
record : 'properties'
}
}
},
loadAll : function() {
var proxy = this.getProxy();
proxy.setExtraParams('');
this.load();
},
createEntry : function ( ... ) { ... }
});
I would like to make a new function 'createEntry' which receives the necessary parameters.
But what do I have to write in this method?
Thank you