Development

Changeset 18919

You must first sign up to be able to contribute.

Changeset 18919

Show
Ignore:
Timestamp:
06/04/09 15:34:17 (4 years ago)
Author:
KRavEN
Message:

added ext2.2 cumulative checkbox bugfixes

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • plugins/sfExtjsThemePlugin/branches/1_2/ExtjsGeneratorPlugin/config/ExtjsGeneratorPluginConfiguration.class.php

    r17569 r18919  
    4444      '/ExtjsGeneratorPlugin/css/symfony-extjs.css', 
    4545      //'/ExtjsGeneratorPlugin/Ext.ux.UploadDialog/css/Ext.ux.UploadDialog.css', 
     46      '/ExtjsGeneratorPlugin/css/Ext.form.Checkbox.override.css',  //consolidated extjs2.2 checkbox bugsfixes 
    4647    ); 
    4748 
     
    6162      //'/ExtjsGeneratorPlugin/js/Ext.Element.override.js',  //adds clone method to element 
    6263       
    63       #'/ExtjsGeneratorPlugin/js/Ext.form.Checkbox.override.js',  //fixes for checkbox alignment issues in IE 
     64      '/ExtjsGeneratorPlugin/js/Ext.form.Checkbox.override.js',  //consolidated extjs2.2 checkbox bugsfixes 
    6465      #'/ExtjsGeneratorPlugin/js/Ext.form.Field.override.js',  //adds ability to set help icon with tooltip to form fields 
    6566 
  • plugins/sfExtjsThemePlugin/branches/1_2/ExtjsGeneratorPlugin/web/js/Ext.form.Checkbox.override.js

    r14781 r18919  
    1 // IE alignment fixes 
    2  
    31Ext.override(Ext.form.Checkbox, { 
    4   getResizeEl : function() 
    5   { 
    6     if (!this.resizeEl) 
    7     { 
    8       this.resizeEl = Ext.isSafari || Ext.isIE ? this.wrap : (this.wrap.up('.x-form-element', 5) || this.wrap); 
     2  onRender: function(ct, position){ 
     3    Ext.form.Checkbox.superclass.onRender.call(this, ct, position); 
     4    if(this.inputValue !== undefined){ 
     5      this.el.dom.value = this.inputValue; 
    96    } 
    10     return this.resizeEl; 
     7    //this.el.addClass('x-hidden'); 
     8    this.innerWrap = this.el.wrap({ 
     9      //tabIndex: this.tabIndex, 
     10      cls: this.baseCls+'-wrap-inner' 
     11    }); 
     12    this.wrap = this.innerWrap.wrap({cls: this.baseCls+'-wrap'}); 
     13    this.imageEl = this.innerWrap.createChild({ 
     14      tag: 'img', 
     15      src: Ext.BLANK_IMAGE_URL, 
     16      cls: this.baseCls 
     17    }); 
     18    if(this.boxLabel){ 
     19      this.labelEl = this.innerWrap.createChild({ 
     20        tag: 'label', 
     21        htmlFor: this.el.id, 
     22        cls: 'x-form-cb-label', 
     23        html: this.boxLabel 
     24      }); 
     25    } 
     26    //this.imageEl = this.innerWrap.createChild({ 
     27      //tag: 'img', 
     28      //src: Ext.BLANK_IMAGE_URL, 
     29      //cls: this.baseCls 
     30    //}, this.el); 
     31    if(this.checked){ 
     32      this.setValue(true); 
     33    }else{ 
     34      this.checked = this.el.dom.checked; 
     35    } 
     36    this.originalValue = this.checked; 
    1137  }, 
    12  
    13   // private 
    14   initEvents : function() 
    15   { 
    16     Ext.form.Checkbox.superclass.initEvents.call(this); 
    17     this.addEvents('reset'); 
    18     this.initCheckEvents(); 
     38  afterRender: function(){ 
     39    Ext.form.Checkbox.superclass.afterRender.call(this); 
     40    //this.wrap[this.checked ? 'addClass' : 'removeClass'](this.checkedCls); 
     41    this.imageEl[this.checked ? 'addClass' : 'removeClass'](this.checkedCls); 
    1942  }, 
    20  
    21   reset : function() 
    22   { 
    23     this.fireEvent('reset', this); 
     43  initCheckEvents: function(){ 
     44    //this.innerWrap.removeAllListeners(); 
     45    this.innerWrap.addClassOnOver(this.overCls); 
     46    this.innerWrap.addClassOnClick(this.mouseDownCls); 
     47    this.innerWrap.on('click', this.onClick, this); 
     48    //this.innerWrap.on('keyup', this.onKeyUp, this); 
     49  }, 
     50  onFocus: function(e) { 
     51    Ext.form.Checkbox.superclass.onFocus.call(this, e); 
     52    //this.el.addClass(this.focusCls); 
     53    this.innerWrap.addClass(this.focusCls); 
     54  }, 
     55  onBlur: function(e) { 
     56    Ext.form.Checkbox.superclass.onBlur.call(this, e); 
     57    //this.el.removeClass(this.focusCls); 
     58    this.innerWrap.removeClass(this.focusCls); 
     59  }, 
     60  onClick: function(e){ 
     61    if (e.getTarget().htmlFor != this.el.dom.id) { 
     62      if (e.getTarget() !== this.el.dom) { 
     63        this.el.focus(); 
     64      } 
     65      if (!this.disabled && !this.readOnly) { 
     66        this.toggleValue(); 
     67      } 
     68    } 
     69    //e.stopEvent(); 
     70  }, 
     71  onEnable: Ext.form.Checkbox.superclass.onEnable, 
     72  onDisable: Ext.form.Checkbox.superclass.onDisable, 
     73  onKeyUp: undefined, 
     74  setValue: function(v) { 
     75    var checked = this.checked; 
     76    this.checked = (v === true || v === 'true' || v == '1' || String(v).toLowerCase() == 'on'); 
     77    if(this.rendered){ 
     78      this.el.dom.checked = this.checked; 
     79      this.el.dom.defaultChecked = this.checked; 
     80      //this.wrap[this.checked ? 'addClass' : 'removeClass'](this.checkedCls); 
     81      this.imageEl[this.checked ? 'addClass' : 'removeClass'](this.checkedCls); 
     82    } 
     83    if(checked != this.checked){ 
     84      this.fireEvent("check", this, this.checked); 
     85      if(this.handler){ 
     86        this.handler.call(this.scope || this, this, this.checked); 
     87      } 
     88    } 
     89  }, 
     90  getResizeEl: function() { 
     91    //if(!this.resizeEl){ 
     92      //this.resizeEl = Ext.isSafari ? this.wrap : (this.wrap.up('.x-form-element', 5) || this.wrap); 
     93    //} 
     94    //return this.resizeEl; 
     95    return this.wrap; 
    2496  } 
    2597}); 
     98Ext.override(Ext.form.Radio, { 
     99  checkedCls: 'x-form-radio-checked' 
     100});