Changeset 30622


Ignore:
Timestamp:
Nov 27, 2014, 11:13:41 AM (9 years ago)
Author:
plg
Message:

bug fixed: replace attr('checked') with prop('checked')

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/GrumPluginClasses/js/ui.inputCheckbox.js

    r16012 r30622  
    9696                function (event)
    9797                {
    98                   privateMethods.setValue($this, $(this).attr('id'), $(this).attr('checked')?options.values.checked:options.values.unchecked,false);
     98                  privateMethods.setValue($this, $(this).attr('id'), $(this).prop('checked')?options.values.checked:options.values.unchecked,false);
    9999                }
    100100              );
     
    202202            var options=this.data('options');
    203203            // return the selected tags
    204             return($(this).find('#'+id).attr('checked')?options.values.checked:options.values.unchecked);
     204            return($(this).find('#'+id).is(':checked')?options.values.checked:options.values.unchecked);
    205205          }
    206206          else
     
    214214                function ()
    215215                {
    216                   returned.push( {id:$(this).attr('id'), value:$(this).attr('checked')?options.values.checked:options.values.unchecked } );
     216                  returned.push( {id:$(this).attr('id'), value:$(this).is(':checked')?options.values.checked:options.values.unchecked } );
    217217                }
    218218              );
     
    407407              {
    408408                case ':all':
    409                   properties.checkboxList.attr('checked', true);
     409                  properties.checkboxList.prop('checked', true);
    410410                  break;
    411411                case ':none':
    412                   properties.checkboxList.attr('checked', false);
     412                  properties.checkboxList.prop('checked', false);
    413413                  break;
    414414                case ':invert':
     
    416416                    function ()
    417417                    {
    418                       $(this).attr('checked', !$(this).attr('checked'));
     418                      $(this).prop('checked', !$(this).prop('checked'));
    419419                    }
    420420                  );
     
    429429               *  [{id:'id1', value:'value1'}, {id:'idN', value:'valueN'}, ..., {id:'idN', value:'valueN'}]
    430430               */
    431               properties.checkboxList.attr('checked', false);
     431              properties.checkboxList.prop('checked', false);
    432432
    433433              for(var i=0;i<value.length;i++)
     
    435435                if(value[i].id!=null && value[i].value!=null)
    436436                {
    437                   if($('#'+value[i].id).attr('value')==value[i].value) $('#'+value[i].id).attr('checked', true);
     437                  if($('#'+value[i].id).attr('value')==value[i].value) $('#'+value[i].id).prop('checked', true);
    438438                }
    439439                else
    440440                {
    441                   properties.checkboxList.filter('[value='+value[i]+']').attr('checked', true);
     441                  properties.checkboxList.filter('[value='+value[i]+']').prop('checked', true);
    442442                }
    443443              }
     
    452452                if(properties.isCB)
    453453                {
    454                   properties.checkboxList.attr('checked', true);
     454                  properties.checkboxList.prop('checked', true);
    455455                }
    456456                else
     
    458458                  if(id=='')
    459459                  {
    460                     properties.checkboxList.attr('checked', true);
     460                    properties.checkboxList.prop('checked', true);
    461461                  }
    462462                  else
    463463                  {
    464                     properties.checkboxList.filter('#'+id).attr('checked', true);
     464                    properties.checkboxList.filter('#'+id).prop('checked', true);
    465465                  }
    466466                }
     
    470470                if(properties.isCB)
    471471                {
    472                   properties.checkboxList.attr('checked', false);
     472                  properties.checkboxList.prop('checked', false);
    473473                }
    474474                else
     
    476476                  if(id=='')
    477477                  {
    478                     properties.checkboxList.attr('checked', false);
     478                    properties.checkboxList.prop('checked', false);
    479479                  }
    480480                  else
    481481                  {
    482                     properties.checkboxList.filter('#'+id).attr('checked', false);
     482                    properties.checkboxList.filter('#'+id).prop('checked', false);
    483483                  }
    484484                }
Note: See TracChangeset for help on using the changeset viewer.