html/modules/pong-table/pong-table.js
function pongTableCmpFields( a, b ) {
  var cellValA = getSubData( a, pongTable_sc );
  var cellValB = getSubData( b, pongTable_sc );
  log( "Pong-Table", 'Sort: '+pongTable_sc+" "+cellValA+" "+cellValB );
  if ( Number( cellValA ) && Number( cellValB ) ) {
    if ( ! isNaN( parseFloat( cellValA ) ) && ! isNaN( parseFloat( cellValB ) ) ) {
      cellValA = parseFloat( cellValA );
      cellValB = parseFloat( cellValB );
      log( "Pong-Table", "parseFloat" );
    } else {
      if ( ! isNaN( parseInt( cellValA ) ) && ! isNaN( parseInt( cellValB ) ) ) {
        cellValA = parseInt( cellValA );
        cellValB = parseInt( cellValB );
        log( "Pong-Table",  "parseInt" );
      }
    }
  }
  if ( cellValA > cellValB  ) {
    return ( pongTable_sort_up ? 1 : -1)
  }
  if ( cellValA < cellValB ) {
    return ( pongTable_sort_up ? -1 : 1)
  }
  return 0;
}
function pongTableCmpFields( a, b ) {
  var cellValA = getSubData( a, pongTable_sc );
  var cellValB = getSubData( b, pongTable_sc );
  log( "Pong-Table", 'Sort: '+pongTable_sc+" "+cellValA+" "+cellValB );
  if ( Number( cellValA ) && Number( cellValB ) ) {
    if ( ! isNaN( parseFloat( cellValA ) ) && ! isNaN( parseFloat( cellValB ) ) ) {
      cellValA = parseFloat( cellValA );
      cellValB = parseFloat( cellValB );
      log( "Pong-Table", "parseFloat" );
    } else {
      if ( ! isNaN( parseInt( cellValA ) ) && ! isNaN( parseInt( cellValB ) ) ) {
        cellValA = parseInt( cellValA );
        cellValB = parseInt( cellValB );
        log( "Pong-Table",  "parseInt" );
      }
    }
  }
  if ( cellValA > cellValB  ) {
    return ( pongTable_sort_up ? 1 : -1)
  }
  if ( cellValA < cellValB ) {
    return ( pongTable_sort_up ? -1 : 1)
  }
  return 0;
}
function pongTableCmpFields ( a , b ) { var cellValA = getSubData ( a , pongTable_sc ) ; var cellValB = getSubData ( b , pongTable_sc ) ; log ( "Pong-Table" , 'Sort: ' + pongTable_sc + " " + cellValA + " " + cellValB ) ; if ( Number ( cellValA ) && Number ( cellValB ) ) { if ( ! isNaN ( parseFloat ( cellValA ) ) && ! isNaN ( parseFloat ( cellValB ) ) ) { cellValA = parseFloat ( cellValA ) ; cellValB = parseFloat ( cellValB ) ; log ( "Pong-Table" , "parseFloat" ) ; } else { if ( ! isNaN ( parseInt ( cellValA ) ) && ! isNaN ( parseInt ( cellValB ) ) ) { cellValA = parseInt ( cellValA ) ; cellValB = parseInt ( cellValB ) ; log ( "Pong-Table" , "parseInt" ) ; } } } if ( cellValA > cellValB ) { return ( pongTable_sort_up ? 1 : - 1 ) } if ( cellValA < cellValB ) { return ( pongTable_sort_up ? - 1 : 1 ) } return 0 ; }
little dirty, but works well
little dirty but works well