Introduction
Minimal js implementation of the combox FunctionCodeFor the page prototype, refer to the combox format of dojo. It supports keyboard operations, automatic filtering, and highlighting.
Encoding method of API Initialization Method
VaRC=NewCombox(Document.Getelementbyid('A'));
Or
VaRC=NewCombox(Document.Getelementbyid('A'),{
Debug:True
});
CSS declaration method
<Select Class="Combox" Debug="True">
As long as the class contains combox, other styles can be included in the class. For example
<Select Class="ABC combox Def">
Or
Configuration parameter description
Combox supports the following configuration parameters:
- Debug: True/false, whether the original select element is visible
- Searchmode: 0 is case-insensitive, and 1 is prefix. Search is case-insensitive.
- Remotesourceurl: Remote Data source URL, which can be in the following JSON format
[
{"Text": "A", "value": "B" },{ "text": "A1", "value": "B1 "}
]
- Remotefilterurl: the remote URL read during filtering. The parameter is XXXX? Asdasd = ~! Value !~,~! Value !~ Macro. It is replaced with the value of the current input box when triggered.
- Allowanyvalue: The default value is false. combox cannot input data in non-Options.
- Displayvalue: The displayed value of combox. When displayvalue can be found in combox options, it displays the text of this option; otherwise, displayvalue is displayed.
- Pleaseselect: When the txtbox value of combox is pleaseselect text, all options are displayed in the drop-down list.
- Mousedblclick: 0 indicates a click, and 1 indicates a double-click.
Example:
VaRC=NewCombox(Document.Getelementbyid('A'),{
Allowanyvalue:True,
Pleasselect:'Select',
Debug:True
})
Or
<Select Class = "Combox" Allowanyvalue = "True" Pleasselect = "Select" Debug = "True" >
Or
Google Code address of the project
Http://code.google.com/p/enhancehtml/
Effect