Introduction
Minimal js implementation of the combox Function Code For the page prototype, refer to the combox format of dojo. It supports keyboard operations, automatic filtering, and highlighting.
API
Initialization Method
Encoding Method
VaR c = new combox (document. getelementbyid ('A '));
Or
VaR c = new combox (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:
VaR c = new combox (document. getelementbyid ('A '),{
Allowanyvalue: True,
Pleasselect: 'Please 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
Demo address http://demo.jb51.net/js/combox/demo.htm
Http://jb51.net/jiaoben/25840.html