Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8526

Re: How to get oData result into an array

$
0
0

Hi Kalpana,

 

oContext.getObject() will return the data object, from there you can access the properties directly.


eg

belnr = oDataArray.getObject().Belnr


referring back to javascript - How to group SAPUI5 OData before bind to control at client side? - Stack Overflow


you could use $.map or array.map to create a new array of objects


eg

var aNewArrary = jQuery.map( oDataArray, function( val, i ) {

 

 

     var obj = val.getObject();

     var newObj = {};

     newObj.Belnr = obj.Belnr;

     newObj.Gjahr = obj.Gjahr;

 

     ....

     newObj.approve = function(){

          //logic for approving

     }

    return newObj;

});

 

 

hth

jsp

 



Viewing all articles
Browse latest Browse all 8526

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>