sergiodlopes / jquery-flexdatalist

Flexible input autocomplete/datalist plugin for jQuery
http://projects.sergiodinislopes.pt/flexdatalist/
MIT License
365 stars 84 forks source link

set the default value in modal bootstrap 3 #231

Open marcipriano opened 3 years ago

marcipriano commented 3 years ago

I'm having trouble setting the default value in modal bootstrap 3. if you have out of modal it works perfectly. before I used a previous version that worked. but in this version the selectionRequired was not working. when updating to the latest version this problem appeared.

when opening the modal I set a default value in flexdatalist. even if I pass the setting inside the modal's opening event it doesn't work.

the fetching data event is triggered. but the default value is not set. it is not the problem of the type because even setting the manual value the value is not assigned to the field.

version: 2.3.0

follow my configuration

$('#corretorAtdm').flexdatalist({ url: "{!! route('admin.access.users.get-users') !!}", cache: false, minLength: 3, params: {andCpf: true}, textProperty: '{name}', valueProperty: 'id', focusFirstResult: true, selectionRequired: true, searchContain: true, visibleProperties: ["name", "cpf", "name_tipo"], searchIn: ["name", "cpf"], noResultsText: '"Sem resultado para {keyword}".' })