Combo
Extend from $.fn.validatebox.defaults. Override defaults with $.fn.combo.defaults.
Dependencies
- validatebox
- panel
Usage
Properties
The properties extend from validatebox, below is the added properties for combo.
| Name | Type | Description | Default | |
|---|---|---|---|---|
| width | number | The width of the component. | auto | |
| panelWidth | number | The drop down panel width. | null | |
| panelHeight | number | The drop down panel height. | 200 | |
| multiple | boolean | Defines if support multiple selection. | false | |
| separator | string | The separator char for text when multiple selection. | , | |
| editable | boolean | Defines if user can type text directly into the field. | true | |
| disabled | boolean | Defines if to disable the field. | false | |
| hasDownArrow | boolean | Defines if to display the down arrow button. | true | |
| value | string | The default value. | ||
| delay | number | Delay to do searching from the last key input event. | 200 | |
| keyHandler | object |
A function called when user press key. The default keyHandler is defined as:
keyHandler: {
up: function(){},
down: function(){},
enter: function(){},
query: function(q){}
}
|
Events
| Name | Parameters | Description |
|---|---|---|
| onShowPanel | none | Fires when drop down panel show. |
| onHidePanel | none | Fires when drop down panel hide. |
| onChange | newValue, oldValue | Fires when the field value is changed. |
Methods
The methods extend from validatebox, below is the added methods for combo.
| Name | Parameter | Description |
|---|---|---|
| options | none | Return the options object. |
| panel | none | Return the drop down panel object. |
| textbox | none | Retun the textbox object. |
| destroy | none | Destroy the component. |
| resize | width | Resize the component width. |
| showPanel | none | Show the drop down panel. |
| hidePanel | none | Hide the drop down panel. |
| disable | none | Disable the component. |
| enable | none | Enable the component. |
| validate | none | Validate the input value. |
| isValid | none | Return the validate result. |
| clear | none | Clear the component value. |
| getText | none | Get the input text. |
| setText | text | Set the text value. |
| getValues | none | Get the component value array. |
| setValues | values | Set the component value array. |
| getValue | none | Get the component value. |
| setValue | value | Set the component value. |