select drop down box plug in jquery. editable select details
- 2021-07-13 04:11:30
- OfStack
There is a requirement in the project. The drop-down box can be selected or filled in manually
html code
<span> Data source </span>
<select class="source">
<option value="0"> Manual import </option>
<option value="1"> Data service platform </option>
</select>
js code
$('#noMean').editableSelect({
filter:false,
effects: 'fade',
duration: 200,
onCreate:function () {
console.log(" Drop-down box creation ")
},
onShow:function () {
console.log(" Drop-down box display ")
},
onHide:function () {
console.log(" Drop-down box hidden ")
},
onSelect:function () {
console.log(" The drop-down box option is selected ")
}
}
Get a value
$(".noMean").val()
After using this plug-in, this one is an input, type= "text"
Parameter
After selecting option for filter, whether to filter the default true
When effects is clicked, the transition effect of the drop-down box has three values: default, slide and fade. The default value is default
duration transition effect time is fast by default. The value can be fast and slow, or it can be a number
appendTo drop-down box This value will be used if the pop-up box effect is applied, showing where to load it
trigger drop-down box list how to trigger the value is "focus", "manual" default is focus
Method
onCreate: Triggered when the editableSelect method takes effect.
onShow: Triggered when the drop-down box appears.
onHide: Triggered when the drop-down box is hidden.
onSelect: Triggered when the option in the drop-down box is selected.
Reference address:
https://www.npmjs.com/package/jquery-editable-select npm Installation
http://indrimuska.github.io/jquery-editable-select/demo Address
https://github.com/zhaobao1830/jquery-editable-select Download address