Ver Mensaje Individual
  #1 (permalink)  
Antiguo 21/09/2011, 07:51
hzapata9
 
Fecha de Ingreso: junio-2008
Mensajes: 53
Antigüedad: 15 años, 11 meses
Puntos: 1
Pregunta Check thousand radio button take many times

hello my friend,

I have a problem, this:

- a configuration page list thousand clients, options are radio button
- i have one chechbox in the first row of the table for each column (group of 3 radio button) for check/uncheck all radio

Problem: Check all radio take more of 30 seconds

I test this:

Case ONE:
checkTodos: class of checkbox
columna + col : class of radio

Código PHP:
function checkMultiple(col){
   $(
'.checkTodos').click(function(event){
     if($(
this).is(':checked')) {
        $(
'.columna'+col).attr('checked''true');
     }else{
        $(
'.columna'+col ':radio:checked').removeAttr('checked');
     }
   });


Case TWO:
checkeado: global variable
Código PHP:
function checkMultiple(col){
    if(
checkeado){
        $(
'.columna5').attr('checked''true');
        
checkeado false;
    }
    else{
        $(
'.columna5').attr('checked''false');
        
checkeado true;
    }