Clear Up
SharpKit Reference

ComboBoxConfig Class

Namespace: Ext.form.field


Name Description


Name Description
allQuery The text query to send to the server to return all records for the list with no filtering Defaults to: ""
autoSelect true to automatically highlight the first result gathered by the data store in the dropdown list when it is opened. A false value would cause nothing in the list to be highlighted automatically, so the user would have to manually highlight an item before pressing the enter or tab key to select it (unless the value of (typeAhead) were true), or use the mouse to select a value. Defaults to: true
defaultListConfig Set of options that will be used as defaults for the user-configured listConfig object. Defaults to: {loadingHeight: 70, minWidth: 70, maxHeight: 300, shadow: "sides"}
delimiter The character(s) used to separate the display values of multiple selected items when multiSelect = true. Defaults to: ", "
displayField The underlying data field name to bind to this ComboBox. See also valueField . Defaults to: "text"
forceSelection true to restrict the selected value to one of the values in the list, false to allow the user to set arbitrary text into the field. Defaults to: false
growToLongestValue false to not allow the component to resize itself when its data changes (and its grow property is true) Defaults to: true
hiddenDataCls CSS class used to find the hiddenDataEl Defaults to: "x-hide-display "
hiddenName The name of an underlying hidden field which will be synchronized with the underlying value of the combo. This option is useful if the combo is part of a form element doing a regular form post. The hidden field will not be created unless a hiddenName is specified. Defaults to: ""
listConfig An optional set of configuration properties that will be passed to the Ext.view.BoundList's constructor. Any configuration that is valid for BoundList can be included. Some of the more useful ones are:
  • cls - defaults to empty
  • emptyText - defaults to empty string
  • itemSelector - defaults to the value defined in BoundList
  • loadingText - defaults to 'Loading...'
  • minWidth - defaults to 70
  • maxWidth - defaults to undefined
  • maxHeight - defaults to 300
  • resizable - defaults to false
  • shadow - defaults to 'sides'
  • width - defaults to undefined (automatically set to the width of the ComboBox field if matchFieldWidth is true)
  • minChars The minimum number of characters the user must type before autocomplete and typeAhead activate. Defaults to 4 if queryMode = 'remote' or 0 if queryMode = 'local', does not apply if editable = false.
    multiSelect If set to true, allows the combo field to hold more than one value at a time, and allows selecting multiple items from the dropdown list. The combo's text field will show all selected values separated by the delimiter. Defaults to: false
    pageSize If greater than 0, a Ext.toolbar.Paging is displayed in the footer of the dropdown list and the filter queries will execute with page start and limit parameters. Only applies when queryMode = 'remote'. Defaults to: 0
    queryCaching When true, this prevents the combo from re-querying (either locally or remotely) when the current query is the same as the previous query. Defaults to: true
    queryDelay The length of time in milliseconds to delay between the start of typing and sending the query to filter the dropdown list. Defaults to 500 if queryMode = 'remote' or 10 if queryMode = 'local'
    queryMode The mode in which the ComboBox uses the configured Store. Acceptable values are:
  • 'remote' :

    In queryMode: 'remote', the ComboBox loads its Store dynamically based upon user interaction.

    This is typically used for "autocomplete" type inputs, and after the user finishes typing, the Store is loaded.

    A parameter containing the typed string is sent in the load request. The default parameter name for the input string is query, but this can be configured using the queryParam config.

    In queryMode: 'remote', the Store may be configured with

    , and further filters may be programatically added to the Store which are then passed with every load request which allows the server to further refine the returned dataset.

    Typically, in an autocomplete situation, hideTrigger is configured true because it has no meaning for autocomplete.

  • 'local' :

    ComboBox loads local data

    var combo = new Ext.form.field.ComboBox({
                renderTo: document.body,
                queryMode: 'local',
                store: new{
                id: 0,
                fields: [
                'myId',  // numeric value is the key
                data: [[1, 'item1'], [2, 'item2']]  // data is local
                valueField: 'myId',
                displayField: 'displayText',
                triggerAction: 'all'
  • Defaults to: "remote"
    queryParam Name of the parameter used by the Store to pass the typed string when the ComboBox is configured with queryMode: 'remote'. If explicitly set to a falsy value it will not be sent. Defaults to: "query"
    selectOnTab Whether the Tab key should select the currently highlighted item. Defaults to: true
    store The data source to which this combo is bound. Acceptable values for this property are:
  • any Store subclass
  • an Array : Arrays will be converted to a internally, automatically generating field names to work with all data components.

    • 1-dimensional array : (e.g., ['Foo','Bar'])

      A 1-dimensional array will automatically be expanded (each array item will be used for both the combo valueField and displayField)

    • 2-dimensional array : (e.g., [['f','Foo'],['b','Bar']])

      For a multi-dimensional array, the value in index 0 of each item will be assumed to be the combo valueField, while the value at index 1 is assumed to be the combo displayField.

  • See also queryMode.
    transform The id, DOM node or Ext.Element of an existing HTML <select> element to convert into a ComboBox. The target select's options will be used to build the options in the ComboBox dropdown; a configured store will take precedence over this.
    triggerAction The action to execute when the trigger is clicked.
  • 'all' :

    run the query specified by the allQuery config option

  • 'query' :

    run the query using the raw value.

  • See also queryParam . Defaults to: "all"
    typeAhead true to populate and autoselect the remainder of the text being typed after a configurable delay (typeAheadDelay) if it matches a known value. Defaults to: false
    typeAheadDelay The length of time in milliseconds to wait until the typeahead text is displayed if typeAhead = true Defaults to: 250
    valueField The underlying data value name to bind to this ComboBox. Note: use of a valueField requires the user to make a selection in order for a value to be mapped. See also displayField . Defaults to match the value of the displayField config.
    valueNotFoundText When using a name/value combo, if the value passed to setValue is not found in the store, valueNotFoundText will be displayed as the field text if defined. If this default text is used, it means there is no value set and no validation will occur on this field.
    © Copyright 2005-2011 SharpKit. All rights reserved.