Advertisement
Guest User

Untitled

a guest
Feb 12th, 2016
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. this.data.sort(function(a , b)
  2. {
  3. if(isNaN(a[col]) || isNaN(b[col]))
  4. {
  5. var temp = new Array(a[col].toUpperCase() , b[col].toUpperCase());
  6.  
  7. var filter = new RegExp(/W/g);
  8. temp[0] = temp[0].replace( filter , "" );
  9. temp[1] = temp[1].replace( filter , "" );
  10. temp.sort();
  11.  
  12. if(temp[0] == a[col].toUpperCase() && temp[1] == b[col].toUpperCase())
  13. {
  14. return -1;
  15. }
  16. else
  17. {
  18. return 1;
  19. }
  20. }
  21. else
  22. {
  23. return a[col] - b[col];
  24. }
  25. });
  26.  
  27. this.data = new Array('9.0','10.1','10.2 Beta 1','9.0','11.0 Beta 1');
  28.  
  29. '9.0','11.0 Beta 1','9.0','10.1',...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement