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

Re: How to sort numbers in SAPUI5?

$
0
0

var id_sort=new sap.ui.model.Sorter("EmpNum");

 

 

 

id_sort.fnCompare = function(a, b){

  var intA = parseInt(a), intB = parseInt(b);

 

  if (intA == intB) {

  return 0;

  }

  if (intA< intB) {

  return -1;

  }

  if (intA> intB) {

  return 1;

  }

  return 0;

};


Viewing all articles
Browse latest Browse all 2823

Trending Articles



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