Ignore:
Timestamp:
Oct 14, 2010, 4:16:32 PM (14 years ago)
Author:
grum
Message:

Fix bug on the categorySelector (multiselect mode) ; add property 'name'
Fix bug on the requestBuilder (add DISTINCT keyword on request...)

File:
1 edited

Legend:

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

    r7175 r7181  
    22 * -----------------------------------------------------------------------------
    33 * file: ui.categorySelector.js
    4  * file version: 1.0.0
     4 * file version: 1.0.1
    55 * date: 2010-10-10
    66 *
     
    2121 *
    2222 * | release | date       |
    23  * | 1.0.0   | 2010/10/10 | first release
     23 * | 1.0.0   | 2010/10/10 | * first release
    2424 * |         |            |
     25 * | 1.0.1   | 2010/10/14 | * fix bug on 'value' functions ':none', ':all' and
     26 * |         |            |   ':invert'
    2527 * |         |            |
    26  * |         |            |
    27  * |         |            |
     28 * |         |            | * add 'name' property
    2829 * |         |            |
    2930 * |         |            |
     
    500501        }, // userMode
    501502
     503      name: function ()
     504        {
     505          var options=this.data('options'),
     506              properties=this.data('properties'),
     507              objects=this.data('objects');
     508
     509          if(!options.multiple)
     510          {
     511            return(properties.categories[properties.index].name);
     512          }
     513          else
     514          {
     515            var listNames=[];
     516            for(var i=0;i<properties.index.length;i++)
     517            {
     518              listNames.push(properties.categories[properties.index[i]].name);
     519            }
     520            return(listNames);
     521          }
     522        }, // userMode
     523
    502524      value: function (value)
    503525        {
     
    10471069            case ':invert':
    10481070              if(!options.multiple) return(false);
    1049 
     1071              properties.index=[];
    10501072              objects.list.find('.ui-category-selector-item').each(
    10511073                function ()
     
    10791101                    {
    10801102                      $this.addClass('ui-category-selector-selected-item');
     1103                      tmp=privateMethods.findIndexByValue(object, $this.attr('catId'));
     1104                      if(tmp>-1) properties.index.push(tmp);
    10811105                    }
    10821106                  }
     
    10881112            case ':none':
    10891113              if(!options.multiple) return(false);
     1114
     1115              properties.index=[];
    10901116              objects.list.find('.ui-category-selector-selected-item').each(
    10911117                function ()
     
    11181144            case ':all':
    11191145              if(!options.multiple) return(false);
     1146              properties.index=[];
    11201147              objects.list.find('.ui-category-selector-item').each(
    11211148                function ()
     
    11391166                    }
    11401167                  }
    1141 
    1142                   if(apply) $this.addClass('ui-category-selector-selected-item');
     1168                  if(apply)
     1169                  {
     1170                    tmp=privateMethods.findIndexByValue(object, $this.attr('catId'));
     1171                    if(tmp>-1) properties.index.push(tmp);
     1172
     1173                    $this.addClass('ui-category-selector-selected-item');
     1174                  }
    11431175                }
    11441176              );
Note: See TracChangeset for help on using the changeset viewer.