4 * Copyright(c) 2006-2007, Ext JS, LLC.
6 * Originally Released Under LGPL - original licence link has changed is not relivant.
9 * <script type="text/javascript">
14 * @class Roo.form.ComboBox
15 * @extends Roo.form.TriggerField
16 * A combobox control with support for autocomplete, remote-loading, paging and many other features.
18 * Create a new ComboBox.
19 * @param {Object} config Configuration options
21 Roo.form.ComboBox = function(config){
22 Roo.form.ComboBox.superclass.constructor.call(this, config);
26 * Fires when the dropdown list is expanded
27 * @param {Roo.form.ComboBox} combo This combo box
32 * Fires when the dropdown list is collapsed
33 * @param {Roo.form.ComboBox} combo This combo box
38 * Fires before a list item is selected. Return false to cancel the selection.
39 * @param {Roo.form.ComboBox} combo This combo box
40 * @param {Roo.data.Record} record The data record returned from the underlying store
41 * @param {Number} index The index of the selected item in the dropdown list
43 'beforeselect' : true,
46 * Fires when a list item is selected
47 * @param {Roo.form.ComboBox} combo This combo box
48 * @param {Roo.data.Record} record The data record returned from the underlying store (or false on clear)
49 * @param {Number} index The index of the selected item in the dropdown list
54 * Fires before all queries are processed. Return false to cancel the query or set cancel to true.
55 * The event object passed has these properties:
56 * @param {Roo.form.ComboBox} combo This combo box
57 * @param {String} query The query
58 * @param {Boolean} forceAll true to force "all" query
59 * @param {Boolean} cancel true to cancel the query
60 * @param {Object} e The query event object
65 * Fires when the 'add' icon is pressed (add a listener to enable add button)
66 * @param {Roo.form.ComboBox} combo This combo box
71 * Fires when the 'edit' icon is pressed (add a listener to enable add button)
72 * @param {Roo.form.ComboBox} combo This combo box
73 * @param {Roo.data.Record|false} record The data record returned from the underlying store (or false on nothing selected)
80 this.allowDomMove = false;
81 var s = Roo.getDom(this.transform);
83 this.hiddenName = s.name;
87 var d = [], opts = s.options;
88 for(var i = 0, len = opts.length;i < len; i++){
90 var value = (Roo.isIE ? o.getAttributeNode('value').specified : o.hasAttribute('value')) ? o.value : o.text;
94 d.push([value, o.text]);
96 this.store = new Roo.data.SimpleStore({
98 fields: ['value', 'text'],
101 this.valueField = 'value';
102 this.displayField = 'text';
104 s.name = Roo.id(); // wipe out the name in case somewhere else they have a reference
105 if(!this.lazyRender){
107 this.el = Roo.DomHelper.insertBefore(s, this.autoCreate || this.defaultAutoCreate);
108 s.parentNode.removeChild(s); // remove it
109 this.render(this.el.parentNode);
111 s.parentNode.removeChild(s); // remove it
116 this.store = Roo.factory(this.store, Roo.data);
119 this.selectedIndex = -1;
120 if(this.mode == 'local'){
121 if(config.queryDelay === undefined){
122 this.queryDelay = 10;
124 if(config.minChars === undefined){
130 Roo.extend(Roo.form.ComboBox, Roo.form.TriggerField, {
132 * @cfg {String/HTMLElement/Element} transform The id, DOM node or element of an existing select to convert to a ComboBox
135 * @cfg {Boolean} lazyRender True to prevent the ComboBox from rendering until requested (should always be used when
136 * rendering into an Roo.Editor, defaults to false)
139 * @cfg {Boolean/Object} autoCreate A DomHelper element spec, or true for a default element spec (defaults to:
140 * {tag: "input", type: "text", size: "24", autocomplete: "off"})
143 * @cfg {Roo.data.Store} store The data store to which this combo is bound (defaults to undefined)
146 * @cfg {String} title If supplied, a header element is created containing this text and added into the top of
147 * the dropdown list (defaults to undefined, with no header element)
151 * @cfg {String/Roo.Template} tpl The template to use to render the output
155 defaultAutoCreate : {tag: "input", type: "text", size: "24", autocomplete: "off"},
157 * @cfg {Number} listWidth The width in pixels of the dropdown list (defaults to the width of the ComboBox field)
159 listWidth: undefined,
161 * @cfg {String} displayField The underlying data field name to bind to this CombBox (defaults to undefined if
162 * mode = 'remote' or 'text' if mode = 'local')
164 displayField: undefined,
166 * @cfg {String} valueField The underlying data value name to bind to this CombBox (defaults to undefined if
167 * mode = 'remote' or 'value' if mode = 'local').
168 * Note: use of a valueField requires the user make a selection
169 * in order for a value to be mapped.
171 valueField: undefined,
173 * @cfg {String} hiddenName If specified, a hidden form field with this name is dynamically generated to store the
174 * field's data value (defaults to the underlying DOM element's name)
176 hiddenName: undefined,
178 * @cfg {String} listClass CSS class to apply to the dropdown list element (defaults to '')
182 * @cfg {String} selectedClass CSS class to apply to the selected item in the dropdown list (defaults to 'x-combo-selected')
184 selectedClass: 'x-combo-selected',
186 * @cfg {String} triggerClass An additional CSS class used to style the trigger button. The trigger will always get the
187 * class 'x-form-trigger' and triggerClass will be <b>appended</b> if specified (defaults to 'x-form-arrow-trigger'
188 * which displays a downward arrow icon).
190 triggerClass : 'x-form-arrow-trigger',
192 * @cfg {Boolean/String} shadow True or "sides" for the default effect, "frame" for 4-way shadow, and "drop" for bottom-right
196 * @cfg {String} listAlign A valid anchor position value. See {@link Roo.Element#alignTo} for details on supported
197 * anchor positions (defaults to 'tl-bl')
201 * @cfg {Number} maxHeight The maximum height in pixels of the dropdown list before scrollbars are shown (defaults to 300)
205 * @cfg {String} triggerAction The action to execute when the trigger field is activated. Use 'all' to run the
206 * query specified by the allQuery config option (defaults to 'query')
208 triggerAction: 'query',
210 * @cfg {Number} minChars The minimum number of characters the user must type before autocomplete and typeahead activate
211 * (defaults to 4, does not apply if editable = false)
215 * @cfg {Boolean} typeAhead True to populate and autoselect the remainder of the text being typed after a configurable
216 * delay (typeAheadDelay) if it matches a known value (defaults to false)
220 * @cfg {Number} queryDelay The length of time in milliseconds to delay between the start of typing and sending the
221 * query to filter the dropdown list (defaults to 500 if mode = 'remote' or 10 if mode = 'local')
225 * @cfg {Number} pageSize If greater than 0, a paging toolbar is displayed in the footer of the dropdown list and the
226 * filter queries will execute with page start and limit parameters. Only applies when mode = 'remote' (defaults to 0)
230 * @cfg {Boolean} selectOnFocus True to select any existing text in the field immediately on focus. Only applies
231 * when editable = true (defaults to false)
235 * @cfg {String} queryParam Name of the query as it will be passed on the querystring (defaults to 'query')
239 * @cfg {String} loadingText The text to display in the dropdown list while data is loading. Only applies
240 * when mode = 'remote' (defaults to 'Loading...')
242 loadingText: 'Loading...',
244 * @cfg {Boolean} resizable True to add a resize handle to the bottom of the dropdown list (defaults to false)
248 * @cfg {Number} handleHeight The height in pixels of the dropdown list resize handle if resizable = true (defaults to 8)
252 * @cfg {Boolean} editable False to prevent the user from typing text directly into the field, just like a
253 * traditional select (defaults to true)
257 * @cfg {String} allQuery The text query to send to the server to return all records for the list with no filtering (defaults to '')
261 * @cfg {String} mode Set to 'local' if the ComboBox loads local data (defaults to 'remote' which loads from the server)
265 * @cfg {Number} minListWidth The minimum width of the dropdown list in pixels (defaults to 70, will be ignored if
266 * listWidth has a higher value)
270 * @cfg {Boolean} forceSelection True to restrict the selected value to one of the values in the list, false to
271 * allow the user to set arbitrary text into the field (defaults to false)
273 forceSelection:false,
275 * @cfg {Number} typeAheadDelay The length of time in milliseconds to wait until the typeahead text is displayed
276 * if typeAhead = true (defaults to 250)
278 typeAheadDelay : 250,
280 * @cfg {String} valueNotFoundText When using a name/value combo, if the value passed to setValue is not found in
281 * the store, valueNotFoundText will be displayed as the field text if defined (defaults to undefined)
283 valueNotFoundText : undefined,
285 * @cfg {bool} blockFocus Prevents all focus calls, so it can work with things like HTML edtor bar
290 * @cfg {bool} disableClear Disable showing of clear button.
292 disableClear : false,
300 onRender : function(ct, position){
301 Roo.form.ComboBox.superclass.onRender.call(this, ct, position);
303 this.hiddenField = this.el.insertSibling({tag:'input', type:'hidden', name: this.hiddenName, id: (this.hiddenId||this.hiddenName)},
305 this.hiddenField.value =
306 this.hiddenValue !== undefined ? this.hiddenValue :
307 this.value !== undefined ? this.value : '';
309 // prevent input submission
310 this.el.dom.removeAttribute('name');
313 this.el.dom.setAttribute('autocomplete', 'off');
316 var cls = 'x-combo-list';
318 this.list = new Roo.Layer({
319 shadow: this.shadow, cls: [cls, this.listClass].join(' '), constrain:false
322 var lw = this.listWidth || Math.max(this.wrap.getWidth(), this.minListWidth);
323 this.list.setWidth(lw);
324 this.list.swallowEvent('mousewheel');
325 this.assetHeight = 0;
328 this.header = this.list.createChild({cls:cls+'-hd', html: this.title});
329 this.assetHeight += this.header.getHeight();
332 this.innerList = this.list.createChild({cls:cls+'-inner'});
333 this.innerList.on('mouseover', this.onViewOver, this);
334 this.innerList.on('mousemove', this.onViewMove, this);
335 this.innerList.setWidth(lw - this.list.getFrameWidth('lr'));
337 if(this.allowBlank && !this.pageSize && !this.disableClear){
338 this.footer = this.list.createChild({cls:cls+'-ft'});
339 this.pageTb = new Roo.Toolbar(this.footer);
343 this.footer = this.list.createChild({cls:cls+'-ft'});
344 this.pageTb = new Roo.PagingToolbar(this.footer, this.store,
345 {pageSize: this.pageSize});
349 if (this.pageTb && this.allowBlank && !this.disableClear) {
351 this.pageTb.add(new Roo.Toolbar.Fill(), {
352 cls: 'x-btn-icon x-btn-clear',
358 _this.onSelect(false, -1);
363 this.assetHeight += this.footer.getHeight();
368 this.tpl = '<div class="'+cls+'-item">{' + this.displayField + '}</div>';
371 this.view = new Roo.View(this.innerList, this.tpl, {
372 singleSelect:true, store: this.store, selectedClass: this.selectedClass
375 this.view.on('click', this.onViewClick, this);
377 this.store.on('beforeload', this.onBeforeLoad, this);
378 this.store.on('load', this.onLoad, this);
379 this.store.on('loadexception', this.collapse, this);
382 this.resizer = new Roo.Resizable(this.list, {
383 pinned:true, handles:'se'
385 this.resizer.on('resize', function(r, w, h){
386 this.maxHeight = h-this.handleHeight-this.list.getFrameWidth('tb')-this.assetHeight;
388 this.innerList.setWidth(w - this.list.getFrameWidth('lr'));
389 this.restrictHeight();
391 this[this.pageSize?'footer':'innerList'].setStyle('margin-bottom', this.handleHeight+'px');
394 this.editable = true;
395 this.setEditable(false);
399 if (typeof(this.events.add.listeners) != 'undefined') {
401 this.addicon = this.wrap.createChild(
402 {tag: 'img', src: Roo.BLANK_IMAGE_URL, cls: 'x-form-combo-add' });
404 this.addicon.on('click', function(e) {
405 this.fireEvent('add', this);
408 if (typeof(this.events.edit.listeners) != 'undefined') {
410 this.editicon = this.wrap.createChild(
411 {tag: 'img', src: Roo.BLANK_IMAGE_URL, cls: 'x-form-combo-edit' });
413 this.editicon.setStyle('margin-left', '40px');
415 this.editicon.on('click', function(e) {
417 // we fire even if inothing is selected..
418 this.fireEvent('edit', this, this.lastData );
428 initEvents : function(){
429 Roo.form.ComboBox.superclass.initEvents.call(this);
431 this.keyNav = new Roo.KeyNav(this.el, {
433 this.inKeyMode = true;
437 "down" : function(e){
438 if(!this.isExpanded()){
439 this.onTriggerClick();
441 this.inKeyMode = true;
446 "enter" : function(e){
456 this.onViewClick(false);
462 doRelay : function(foo, bar, hname){
463 if(hname == 'down' || this.scope.isExpanded()){
464 return Roo.KeyNav.prototype.doRelay.apply(this, arguments);
471 this.queryDelay = Math.max(this.queryDelay || 10,
472 this.mode == 'local' ? 10 : 250);
473 this.dqTask = new Roo.util.DelayedTask(this.initQuery, this);
475 this.taTask = new Roo.util.DelayedTask(this.onTypeAhead, this);
477 if(this.editable !== false){
478 this.el.on("keyup", this.onKeyUp, this);
480 if(this.forceSelection){
481 this.on('blur', this.doForce, this);
485 onDestroy : function(){
487 this.view.setStore(null);
488 this.view.el.removeAllListeners();
489 this.view.el.remove();
490 this.view.purgeListeners();
496 this.store.un('beforeload', this.onBeforeLoad, this);
497 this.store.un('load', this.onLoad, this);
498 this.store.un('loadexception', this.collapse, this);
500 Roo.form.ComboBox.superclass.onDestroy.call(this);
504 fireKey : function(e){
505 if(e.isNavKeyPress() && !this.list.isVisible()){
506 this.fireEvent("specialkey", this, e);
511 onResize: function(w, h){
512 Roo.form.ComboBox.superclass.onResize.apply(this, arguments);
514 if(typeof w != 'number'){
515 // we do not handle it!?!?
518 var tw = this.trigger.getWidth();
519 tw += this.addicon ? this.addicon.getWidth() : 0;
520 tw += this.editicon ? this.editicon.getWidth() : 0;
522 this.el.setWidth( this.adjustWidth('input', x));
524 this.trigger.setStyle('left', x+'px');
526 if(this.list && this.listWidth === undefined){
527 var lw = Math.max(x + this.trigger.getWidth(), this.minListWidth);
528 this.list.setWidth(lw);
529 this.innerList.setWidth(lw - this.list.getFrameWidth('lr'));
537 * Allow or prevent the user from directly editing the field text. If false is passed,
538 * the user will only be able to select from the items defined in the dropdown list. This method
539 * is the runtime equivalent of setting the 'editable' config option at config time.
540 * @param {Boolean} value True to allow the user to directly edit the field text
542 setEditable : function(value){
543 if(value == this.editable){
546 this.editable = value;
548 this.el.dom.setAttribute('readOnly', true);
549 this.el.on('mousedown', this.onTriggerClick, this);
550 this.el.addClass('x-combo-noedit');
552 this.el.dom.setAttribute('readOnly', false);
553 this.el.un('mousedown', this.onTriggerClick, this);
554 this.el.removeClass('x-combo-noedit');
559 onBeforeLoad : function(){
563 this.innerList.update(this.loadingText ?
564 '<div class="loading-indicator">'+this.loadingText+'</div>' : '');
565 this.restrictHeight();
566 this.selectedIndex = -1;
574 if(this.store.getCount() > 0){
576 this.restrictHeight();
577 if(this.lastQuery == this.allQuery){
579 this.el.dom.select();
581 if(!this.selectByValue(this.value, true)){
582 this.select(0, true);
586 if(this.typeAhead && this.lastKey != Roo.EventObject.BACKSPACE && this.lastKey != Roo.EventObject.DELETE){
587 this.taTask.delay(this.typeAheadDelay);
591 this.onEmptyResults();
597 onTypeAhead : function(){
598 if(this.store.getCount() > 0){
599 var r = this.store.getAt(0);
600 var newValue = r.data[this.displayField];
601 var len = newValue.length;
602 var selStart = this.getRawValue().length;
604 this.setRawValue(newValue);
605 this.selectText(selStart, newValue.length);
611 onSelect : function(record, index){
612 if(this.fireEvent('beforeselect', this, record, index) !== false){
613 this.setFromData(index > -1 ? record.data : false);
615 this.fireEvent('select', this, record, index);
620 * Returns the currently selected field value or empty string if no value is set.
621 * @return {String} value The selected value
623 getValue : function(){
625 return typeof this.value != 'undefined' ? this.value : '';
627 return Roo.form.ComboBox.superclass.getValue.call(this);
632 * Clears any text/value currently set in the field
634 clearValue : function(){
635 if(this.hiddenField){
636 this.hiddenField.value = '';
639 this.setRawValue('');
640 this.lastSelectionText = '';
641 this.applyEmptyText();
645 * Sets the specified value into the field. If the value finds a match, the corresponding record text
646 * will be displayed in the field. If the value does not match the data value of an existing item,
647 * and the valueNotFoundText config option is defined, it will be displayed as the default field text.
648 * Otherwise the field will be blank (although the value will still be set).
649 * @param {String} value The value to match
651 setValue : function(v){
654 var r = this.findRecord(this.valueField, v);
656 text = r.data[this.displayField];
657 }else if(this.valueNotFoundText !== undefined){
658 text = this.valueNotFoundText;
661 this.lastSelectionText = text;
662 if(this.hiddenField){
663 this.hiddenField.value = v;
665 Roo.form.ComboBox.superclass.setValue.call(this, text);
669 * @property {Object} the last set data for the element
674 * Sets the value of the field based on a object which is related to the record format for the store.
675 * @param {Object} value the value to set as. or false on reset?
677 setFromData : function(o){
678 var dv = ''; // display value
679 var vv = ''; // value value..
681 if (this.displayField) {
682 dv = !o || typeof(o[this.displayField]) == 'undefined' ? '' : o[this.displayField];
684 // this is an error condition!!!
685 console.log('no value field set for '+ this.name);
689 vv = !o || typeof(o[this.valueField]) == 'undefined' ? dv : o[this.valueField];
691 if(this.hiddenField){
692 this.hiddenField.value = vv;
694 this.lastSelectionText = dv;
695 Roo.form.ComboBox.superclass.setValue.call(this, dv);
699 // no hidden field.. - we store the value in 'value', but still display
701 this.lastSelectionText = dv;
702 Roo.form.ComboBox.superclass.setValue.call(this, dv);
709 // overridden so that last data is reset..
710 this.setValue(this.originalValue);
712 this.lastData = false;
715 findRecord : function(prop, value){
717 if(this.store.getCount() > 0){
718 this.store.each(function(r){
719 if(r.data[prop] == value){
729 onViewMove : function(e, t){
730 this.inKeyMode = false;
734 onViewOver : function(e, t){
735 if(this.inKeyMode){ // prevent key nav and mouse over conflicts
738 var item = this.view.findItemFromChild(t);
740 var index = this.view.indexOf(item);
741 this.select(index, false);
746 onViewClick : function(doFocus){
747 var index = this.view.getSelectedIndexes()[0];
748 var r = this.store.getAt(index);
750 this.onSelect(r, index);
752 if(doFocus !== false && !this.blockFocus){
758 restrictHeight : function(){
759 this.innerList.dom.style.height = '';
760 var inner = this.innerList.dom;
761 var h = Math.max(inner.clientHeight, inner.offsetHeight, inner.scrollHeight);
762 this.innerList.setHeight(h < this.maxHeight ? 'auto' : this.maxHeight);
763 this.list.beginUpdate();
764 this.list.setHeight(this.innerList.getHeight()+this.list.getFrameWidth('tb')+(this.resizable?this.handleHeight:0)+this.assetHeight);
765 this.list.alignTo(this.el, this.listAlign);
766 this.list.endUpdate();
770 onEmptyResults : function(){
775 * Returns true if the dropdown list is expanded, else false.
777 isExpanded : function(){
778 return this.list.isVisible();
782 * Select an item in the dropdown list by its data value. This function does NOT cause the select event to fire.
783 * The store must be loaded and the list expanded for this function to work, otherwise use setValue.
784 * @param {String} value The data value of the item to select
785 * @param {Boolean} scrollIntoView False to prevent the dropdown list from autoscrolling to display the
786 * selected item if it is not currently in view (defaults to true)
787 * @return {Boolean} True if the value matched an item in the list, else false
789 selectByValue : function(v, scrollIntoView){
790 if(v !== undefined && v !== null){
791 var r = this.findRecord(this.valueField || this.displayField, v);
793 this.select(this.store.indexOf(r), scrollIntoView);
801 * Select an item in the dropdown list by its numeric index in the list. This function does NOT cause the select event to fire.
802 * The store must be loaded and the list expanded for this function to work, otherwise use setValue.
803 * @param {Number} index The zero-based index of the list item to select
804 * @param {Boolean} scrollIntoView False to prevent the dropdown list from autoscrolling to display the
805 * selected item if it is not currently in view (defaults to true)
807 select : function(index, scrollIntoView){
808 this.selectedIndex = index;
809 this.view.select(index);
810 if(scrollIntoView !== false){
811 var el = this.view.getNode(index);
813 this.innerList.scrollChildIntoView(el, false);
819 selectNext : function(){
820 var ct = this.store.getCount();
822 if(this.selectedIndex == -1){
824 }else if(this.selectedIndex < ct-1){
825 this.select(this.selectedIndex+1);
831 selectPrev : function(){
832 var ct = this.store.getCount();
834 if(this.selectedIndex == -1){
836 }else if(this.selectedIndex != 0){
837 this.select(this.selectedIndex-1);
843 onKeyUp : function(e){
844 if(this.editable !== false && !e.isSpecialKey()){
845 this.lastKey = e.getKey();
846 this.dqTask.delay(this.queryDelay);
851 validateBlur : function(){
852 return !this.list || !this.list.isVisible();
856 initQuery : function(){
857 this.doQuery(this.getRawValue());
861 doForce : function(){
862 if(this.el.dom.value.length > 0){
864 this.lastSelectionText === undefined ? '' : this.lastSelectionText;
865 this.applyEmptyText();
870 * Execute a query to filter the dropdown list. Fires the beforequery event prior to performing the
871 * query allowing the query action to be canceled if needed.
872 * @param {String} query The SQL query to execute
873 * @param {Boolean} forceAll True to force the query to execute even if there are currently fewer characters
874 * in the field than the minimum specified by the minChars config option. It also clears any filter previously
875 * saved in the current store (defaults to false)
877 doQuery : function(q, forceAll){
878 if(q === undefined || q === null){
887 if(this.fireEvent('beforequery', qe)===false || qe.cancel){
891 forceAll = qe.forceAll;
892 if(forceAll === true || (q.length >= this.minChars)){
893 if(this.lastQuery != q){
895 if(this.mode == 'local'){
896 this.selectedIndex = -1;
898 this.store.clearFilter();
900 this.store.filter(this.displayField, q);
904 this.store.baseParams[this.queryParam] = q;
906 params: this.getParams(q)
911 this.selectedIndex = -1;
918 getParams : function(q){
920 //p[this.queryParam] = q;
923 p.limit = this.pageSize;
929 * Hides the dropdown list if it is currently expanded. Fires the 'collapse' event on completion.
931 collapse : function(){
932 if(!this.isExpanded()){
936 Roo.get(document).un('mousedown', this.collapseIf, this);
937 Roo.get(document).un('mousewheel', this.collapseIf, this);
938 if (!this.editable) {
939 Roo.get(document).un('keydown', this.listKeyPress, this);
941 this.fireEvent('collapse', this);
945 collapseIf : function(e){
946 if(!e.within(this.wrap) && !e.within(this.list)){
952 * Expands the dropdown list if it is currently hidden. Fires the 'expand' event on completion.
955 if(this.isExpanded() || !this.hasFocus){
958 this.list.alignTo(this.el, this.listAlign);
960 Roo.get(document).on('mousedown', this.collapseIf, this);
961 Roo.get(document).on('mousewheel', this.collapseIf, this);
962 if (!this.editable) {
963 Roo.get(document).on('keydown', this.listKeyPress, this);
966 this.fireEvent('expand', this);
970 // Implements the default empty TriggerField.onTriggerClick function
971 onTriggerClick : function(){
975 if(this.isExpanded()){
977 if (!this.blockFocus) {
982 this.hasFocus = true;
983 if(this.triggerAction == 'all') {
984 this.doQuery(this.allQuery, true);
986 this.doQuery(this.getRawValue());
988 if (!this.blockFocus) {
993 listKeyPress : function(e)
995 //Roo.log('listkeypress');
996 // scroll to first matching element based on key pres..
997 if (e.isSpecialKey()) {
1000 var k = String.fromCharCode(e.getKey()).toUpperCase();
1003 this.store.each(function(v) {
1004 if (v.get(combo.displayField).substring(0,1).toUpperCase() == k) {
1005 match = this.store.indexOf(v);
1010 if (match === false) {
1011 return true; // no more action?
1014 this.view.select(match);
1015 var sn = Roo.get(combo.view.getSelectedNodes()[0])
1016 sn.scrollIntoView(sn.dom.parentNode, false);
1020 * @cfg {Boolean} grow
1024 * @cfg {Number} growMin
1028 * @cfg {Number} growMax