Ver Mensaje Individual
  #3 (permalink)  
Antiguo 18/04/2013, 08:56
Avatar de catpaw
catpaw
 
Fecha de Ingreso: mayo-2010
Ubicación: xalapa
Mensajes: 856
Antigüedad: 13 años, 11 meses
Puntos: 23
Respuesta: funcion para hacer un sort numerico

hola david, gracias por tu respuesta

probe tu codigo pero me marca error en el replace y se lo quite mejor, quedando asi:

Código Javascript:
Ver original
  1. return alert(((parseFloat(a) > parseFloat(b)) ? 1 : -1));

Pero pasa que sigue acomodando mal. No se no esta tomando el parse o no se que, mira asi es la funcioncita:

Código Javascript:
Ver original
  1. <th field="costo_unitario" width="90" rowspan="2"
  2.  
  3.     data-options="
  4.        align:'right',
  5.        formatter:formatPrice,
  6.        sorter:function(a,b){
  7.            return alert(((parseFloat(a) > parseFloat(b)) ? 1 : -1));
  8.        }
  9.    " sortable="true">
  10.  
  11.     Costo</th>

Este es el tutorial del framework que ocupo:

Para agregar el sorting nativo:

http://www.jeasyui.com/tutorial/datagrid/datagrid8.php

Y para el sorting personalizado:

http://www.jeasyui.com/tutorial/datagrid/datagrid14.php

que podra ser?