Giter Club home page Giter Club logo

autocompletebundle's People

Contributors

burgov avatar erikroelofs avatar knalblauw avatar samsonit-jelle avatar schizoduckie avatar uwej711 avatar wizart avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

autocompletebundle's Issues

Autocompleter don't work with сyrillic query

When I search сyrillic text this autocompleter don't work.

For fix this bug change code in line 29 (autocomplete.js) to this code
data = data + "&__autocomplete_search=" + encodeURI(options.term);

PostgreSQL's LIKE is case sensitive

The LIKE function in PostgreSQL is unfortunately case sensitive, while other SQL systems are case insensitive with LIKE.

To get consistent behavior I would suggest the following change:

Query\ResultsFetcher.php, line 66

                $expressions[] = $qb->expr()->like('LOWER(' . $field . ')', ':query' . $key . $key2);
                $qb->setParameter('query' . $key . $key2, '%' . strtolower($searchWord) . '%');

Issue with caching?

Hi Bart,

I have one more small issue that I can't seem to figure out.

The form I'm using the autocomplete in is a modal that is used to add participants for a few different entities on the page. In order to get the right form values I refresh the form through an ajax call. I'm using the query builder to filter out the existing participants so one participant can't be added twice.

If I add this to the form type:

->add('participant',null,array(
        'label'=> _('Deelnemer'),
        'empty_value' => 'Nieuwe deelnemer',
                    'query_builder' => function(ParticipantRepository $pr) use($courseBlock) {
        return $pr->getParticipantsNotInCourseBlock($courseBlock);
    }

It works fine, for each entity the correct items are filtered out.
However, when I try the same with the autocomplete:

              ->add('participant', 'autocomplete',array('label' => _('Deelnemer'),
                    'class' => 'MyBundle:Participant',
                    'search_fields' => array('p.firstName', 'p.lastName'),
                    'template' => 'MyBundle:Autocomplete:participant_autocomplete.html.twig',
                    'query_builder' => function(ParticipantRepository $pr) use($courseBlock) {
                        return $pr->getParticipantsNotInCourseBlock($courseBlock);
                    }

it filters out the participants of the default entity only, not the selected entity with which the form is rendered through ajax.
I'm guessing this might be some type of caching issue but I can't seem to figure out how to solve it. Could you point me in the right direction?

PropertyAccess component is Symfony 2.2+

Hi Bart,

I just tried out your autocomplete bundle in Symfony 2.1.8, unfortunately after getting everything set up right I got a fatal error because

Fatal error: Class 'Symfony\Component\PropertyAccess\PropertyAccess' not found in /xxx/vendor/samson/autocomplete-bundle/Samson/Bundle/AutocompleteBundle/Form/Listener/AutoCompleteTypeListener.php on line 68

I looked it up and it seems that the PropertyAccess component is new for Symfony 2.2:
http://symfony.com/blog/new-in-symfony-2-2-new-propertyaccess-component

I'll try upgrading to Symfony 2.2 some time in the next few weeks, but the requirements for this Bundle aren't correct at the moment.

See you at the meetup!

Can`t get it running! Please help

I have the symfony 2.1, then i tried with 2.1@dev version of the bundle, but I don´t find an example of this bundle on google and i don´t understand how the one on the showcase works, i tried a lot but i can´t get it running. I know this isnt the best place to ask, but i dont find nothing out there.

Thanks

Highlight does not work

since the LabelBuilder doesn't know what was actually searched, search_words are the search-fields, the search_words are only in the request.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.