Changeset 13614
- Timestamp:
- 05/07/08 04:51:34 (7 months ago)
- Location:
- dijit/trunk
- Files:
-
- 2 modified
-
form/ComboBox.js (modified) (3 diffs)
-
tests/form/test_ComboBox.html (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
dijit/trunk/form/ComboBox.js
r13547 r13614 40 40 autoComplete: true, 41 41 42 // highlightMatch: Boolean 42 // highlightMatch: String 43 // One of: "first", "all" or "none". 43 44 // If the ComboBox opens with the serach results and the searched 44 45 // string can be found it will be highlighted. 45 46 // This value is not considered when labelType!="text" to not 46 47 // screw up any mark up the label might contain. 47 highlightMatch: true,48 highlightMatch: "first", 48 49 49 50 // searchDelay: Integer … … 636 637 var labelType = this.labelType; 637 638 // If labelType is not "text" we don't want to screw any markup ot whatever. 638 if (this.highlightMatch ==true&& this.labelType=="text" && this._lastInput){639 if (this.highlightMatch!="none" && this.labelType=="text" && this._lastInput){ 639 640 label = this.doHighlight(label); 640 641 labelType = "html"; … … 649 650 // to implement your custom highlighing. 650 651 return this._escapeHtml(label).replace( 651 new RegExp("("+ this._escapeHtml(this._lastInput) +")", "i"), 652 // Add greedy when this.highlightMatch=="all" 653 new RegExp("("+ this._escapeHtml(this._lastInput) +")", "i"+(this.highlightMatch=="all"?"g":"")), 652 654 '<span class="dijitComboBoxHighlightMatch">$1</span>'); 653 655 // returns String, (almost) valid HTML (entities encoded) -
dijit/trunk/tests/form/test_ComboBox.html
r13288 r13614 205 205 </div> 206 206 <hr> 207 <p>ComboBox #4: url, autoComplete=false required=true and highlightMatch= false</p>207 <p>ComboBox #4: url, autoComplete=false required=true and highlightMatch="none"</p> 208 208 <label for="combobox4">US State test 4: </label> 209 209 <input dojoType="dijit.form.ComboBox" … … 218 218 id="combobox4" 219 219 required="true" 220 highlightMatch=" false"220 highlightMatch="none" 221 221 > 222 222 <span>Value: <input id="value4" disabled></span> 223 223 <hr> 224 <p>A ComboBox with no arrow </p>224 <p>A ComboBox with no arrow, and with highlightMatch="all", which highlights all matches (the server is not searching accordingly!)</p> 225 225 <input dojoType="dijit.form.ComboBox" 226 226 value="California" … … 230 230 autoComplete="false" 231 231 hasDownArrow="false" 232 highlightMatch="all" 232 233 > 233 234 <hr>