jesterxl

Untitled

Sep 20th, 2012
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. list.sort(function(a, b) {
  2.  
  3.           if(typeof a == 'undefined')
  4.           {
  5.               return -1;
  6.           }
  7.  
  8.           if(typeof b == 'undefined')
  9.           {
  10.               return 1;
  11.           }
  12.  
  13.           if(typeof a.gridSortOrder == 'undefined')
  14.           {
  15.               return -1;
  16.           }
  17.  
  18.           if(typeof b.gridSortOrder == 'undefined')
  19.           {
  20.               return 1;
  21.           }
  22.  
  23.           var aNum = parseInt(a.gridSortOrder);
  24.           var bNum = parseInt(b.gridSortOrder);
  25.  
  26.         return aNum > bNum;
  27.       });
Advertisement
Add Comment
Please, Sign In to add comment