Changeset 1507


Ignore:
Timestamp:
2010-04-19 12:06:04 (3 years ago)
Author:
freya
Message:

trac #265: for some reason adding the "disable" option does not work for the jquery datepicker but .datepicker("disable") does work

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/modules/kauri-forms/kauri-forms-framework/src/main/kauri/static-{build}.key/kauri.forms/date.js

    r1479 r1507  
    350350                options = $.extend(options, this.pickerOptions); 
    351351            } 
    352              
     352                         
    353353            $input.datepicker(options); 
     354 
     355            // for some reason adding the "disable" option does not work but calling .datepicker("disable") does work 
     356            if(!(this.initial.enable)) 
     357                $input.datepicker("disable"); 
    354358        } 
    355359        this._input = $input; 
     
    383387    }     
    384388     
     389    DateControl.prototype.enable = function(){ 
     390     
     391//        for (var rel in this._elements) { 
     392//            var el = this.getElement(rel); 
     393//            if (el.is(":disabled")) { 
     394//                el.removeAttr("disabled"); 
     395//            } 
     396//            el.removeClass("disabled"); 
     397//        } 
     398//        this.operationalState = Control.STATE_ENABLED; 
     399//        // If the control isn't in STATE_INIT, we should re-validate to restore validation messages that may have been present when disable() was called 
     400//        if (this.valueState != Control.STATE_INIT) { 
     401//          this.newValidation(this.getValue(), this.getWireValue()); 
     402//        }; 
     403    } 
     404     
     405    /** 
     406     * Disables the control 
     407     */ 
     408     DateControl.prototype.disable = function(){ 
     409//        for (var rel in this._elements) { 
     410//            var el = this._elements[rel]; 
     411//            if (el.is(":enabled")) { 
     412//                el.attr("disabled", "disabled"); 
     413//            } 
     414//            el.addClass("disabled"); 
     415//        } 
     416//        this.clearMessage(); 
     417//        this.operationalState = Control.STATE_DISABLED; 
     418    } 
     419 
     420     
    385421    controlTypes.put( "date-control", DateControl); 
    386422})(jQuery); 
Note: See TracChangeset for help on using the changeset viewer.