Comments (5)
Hi,
I've created a 2.1 branch which I got working in a SF2.1 project. Let me know if it works for you as well.
See you tomorrow at the meetup!
Regards,
Bart
from autocompletebundle.
Hi Bart,
I've upgraded to 2.2, and the bundle seems to be working, but I'm unclear as to how to make this work inside an exisiting form builder. At first I got just an UnexpectedResponseException with no info, when I commented that line out I got constraint violation exceptions which happen because it seems the whole form is being submitted, which makes sense, but then it's not clear to me how I could integrate the autocomplete in an exisiting form with a select2 box.
This is what I have in my form builder:
$builder
/* Samson autocomplete bundle doesn't work in this setup, submits whole form. */
->add('participant', 'autocomplete',array('label' => _('Deelnemer'),
'class' => 'MyBundle:Participant',
'search_fields' => array('autocomplete.firstName'),
'template' => 'MyBundle:Autocomplete:participant_autocomplete.html.twig',
))
//old participant select
//->add('participant',null,array('label'=> _('Deelnemer'), 'empty_value' => 'Nieuwe deelnemer'))
->add('registrationDate',null,array('label' => _('Registratie datum'),
'format' => 'dd-MM-yyyy HH:mm:ss',
'widget' => 'single_text',
))
->add('paid', null, array('label' => _('Betaald')))
->add('active', null, array('label' => _('Actief')))
;
from autocompletebundle.
Hi,
I've updated the tag on the unexpectedresponse bundle, so now when you run composer, you should get a newer version which will actually explain what went wrong.
Basically, you'll need to enable this UnexpectedResponseBundle in your AppKernel. Then, everything should work as expected. I'll add a note on this in the docs.
Hope it helps!
from autocompletebundle.
Thanks! It works now, just one issue, it now starts searching as soon as you click in the field. I tried adding
'validation_constraint' => new NotNull()
but it still displays all options as soon as you click the box, which kind of defeats the purpose....
I added
minimumInputLength: 2,
to autocomplete.js to fix this.
One other thing is that I noticed the search is case sensitive (while the default select2 behaviour is not). Would be nice if it could be case insensitive.
from autocompletebundle.
if i'm not mistaken all searching is done on the server side, so if it turns out to be case sensitive, I guess it should be solved there somehow. We haven't had problems with case sensitivity yet...
a setting for min input length could indeed be desirable. For us the minlength of 0 was chosen deliberately, but might not always be optimal
from autocompletebundle.
Related Issues (13)
- Change type hints so that the bundle can be used with Doctrine ODM as well
- Move the getLabel() logic out of the AutocompleteType class HOT 1
- Extend the EntityIdentifierType if it ever gets pulled to symfony master HOT 1
- Build tests!
- When an error occurs in the AJAX request, a link is shown to the profiler, but the script name (app_dev.php) is missing from the link
- Figure out a way to ensure all assets are loaded by the user
- Figure out a way to have autocomplete.html.twig always being loaded
- Issue with caching? HOT 4
- Can`t get it running! Please help HOT 1
- Autocompleter don't work with сyrillic query HOT 2
- Highlight does not work HOT 1
- PostgreSQL's LIKE is case sensitive HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from autocompletebundle.