Changeset 1649


Ignore:
Timestamp:
2010-08-06 14:05:22 (3 years ago)
Author:
freya
Message:

Solves #267 : autocomplete should handle 'noValidation' parameter

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/modules/kauri-forms/kauri-forms-extra/src/main/kauri/static/autocomplete/js/autocomplete.js

    r1480 r1649  
    1818    } 
    1919 
    20     AutocompleteControl.prototype.elements = {}; 
    21     $.extend(AutocompleteControl.prototype.elements, kf.Control.prototype.elements); 
    22     $.extend(AutocompleteControl.prototype.elements, { 
    23         input : { 
    24             /* Kauri Forms needs an input-role element, but we don't (want to use the 'input' role), therefore 
    25                simply create a hidden div. */ 
    26             create : "<div style='display:none'/>" 
    27         }, 
    28         acinput : { 
    29             create : "<input type='text'/>" 
    30         } 
     20    AutocompleteControl.prototype.templates = {}; 
     21    $.extend(AutocompleteControl.prototype.templates, kf.Control.prototype.templates); 
     22    $.extend(AutocompleteControl.prototype.templates, { 
     23           control :  
     24             "<input type='text' kauri-role='acinput'/>" 
    3125    }); 
    3226 
     
    9185    } 
    9286 
    93     AutocompleteControl.prototype.setValue = function(value) { 
    94         this["<super.call>"]("setValue", [value]); 
     87    AutocompleteControl.prototype.setValue = function(value, noValidation) { 
     88        kf.Control.setValue(this, value, noValidation); 
    9589    } 
    9690 
     
    9993    } 
    10094 
    101     AutocompleteControl.prototype.setWireValue = function(wireValue) { 
     95    AutocompleteControl.prototype.setWireValue = function(wireValue, noValidation) { 
    10296      if (wireValue === undefined) { 
    103         this.setValue(undefined); 
     97        this.setValue(undefined, noValidation); 
    10498        this.$acinput.val(''); 
    10599      } else { 
    106         this.setValue(wireValue) 
     100        this.setValue(wireValue, noValidation); 
    107101        this.$acinput.val(this.inputTemplate.expand(this.getValue(), true)); 
    108102      } 
Note: See TracChangeset for help on using the changeset viewer.