send json object to xsjs code example
Example 1: send json object to xsjs
var JSONString = $.request.parameters.get("JSON_DATA");
var JSONObj = JSON.parse(JSONString);
$.response.setBody(JSONObj.length);
Example 2: send json object to xsjs
return new sap.ui.commons.layout.MatrixLayout({
id : "matrix1",
layoutFixed : false
}).createRow(oTable).
createRow(new sap.ui.commons.Button({
text : "Submit",
press : function(evt){
var JSONData = oTable.getBinding().getModel().oData.modelData;
var JSONString = JSON.stringify(JSONData);
$.post("proxy/Finance/XSApps/test.xsjs",
{ JSON_DATA: JSONString }
).done(function( data ) {
alert( "Data returned rom XSJS: " + data );
});
}