dropdown with input
dropdown with input
Hello,
i have editor datatables with dropdown list. Unfortunately, the list is far too long and it always takes a while to find the right entry. For this reason I want a dropdown with an input field where after typing letters the list gets smaller and you can then select an entry from the list. But you can't write something yourself, you can always take it from the list.
.....fields: [
{
label: "Person",
name: "Person",
type: "select",
options: dropdownPerson.value
}.......
thanks
Answers
Have a look at the Select2 input.
can you maybe adapt it to my code? what does it look like then? type=select2 doesn't work
I see you're using Editor in your example, but our accounts aren't showing that you have a license. Is the license registered to another email address? Please can let us know so we can update our records and provide support.
Thanks,
Colin
hi @colin , this is my private account I have the licenses in my work account
OK, could you PM me the account that holds those details, please.
Colin
This example in this thread should help, as it's demonstrating just that. The 'Office' field has a Select2 control that allows filtering on the options. The code pasted at the front is the
Select2 plugin,
Colin
is this the correct way to add the plug in code to the html?
<script type="text/javascript" src="~/lib/DataTables/Select2-4.0.2/js/plugin.js"></script>
in plugin.js is all the code from the downloaded plugin
Looks good to me. If you have Select2 loaded in as well.
Allan
hi Allan,
yes I did, but I get this error:
editor.select2.js:112 Uncaught TypeError: Cannot read properties of undefined (reading 'ext')
at editor.select2.js:112:20
at editor.select2.js:106:9
at editor.select2.js:108:2
I fixed the error above, it was due to the order of the scripts, but unfortunately it still doesn't work. For "Person" I have no input field, no dropdown... nothing at all
div class = select2-hidden-accessible fluid selection ui dropdown
it always automatically makes the field hidden. I see that in developer mode, as soon as I remove hidden the dropdown is visible...
I'd really need a link to your page. You can PM it to me if you don't want to make it public.
Allan