Would it be possible to add an option to have the filter query automatically run after an autocomplete selection has been made? Ideally, the option could be toggled with a checkbox in the view settings after the filter has been added.

This is configurable with the Finder module http://drupal.org/project/finder and it would make Autocomplete Filters more convenient.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

santiwww’s picture

I needed the same functionality so I created a patch to include it.
To use it there's a modification needed in autocomplete.js from core which already has a patch (#365241: Add select event to autocomplete feature)
I've tested it with drupal 7.34.

victoriachan’s picture

Tested. This works great for me. Thanks!

I've rerolled the patch as it somehow didn't apply for me.

vasike’s picture

Status: Needs review » Needs work

i couldn't make it work.
I'm not sure the autosubmit js works.

am i missing something?
thank you

ivoo56’s picture

Thanks santiwww !
Autocomplete patch worked for me, but only after I turned Use Ajax to Yes in view configuration tab. I did not need to apply the core patch because my D7 version already had it.

edurenye’s picture

Version: 7.x-1.x-dev » 8.x-1.x-dev
Status: Needs work » Needs review
FileSize
3.13 KB

I think that option must default to TRUE.
This issue also happens in d8, so I fixed it there. When fixed we can backport it.

edurenye’s picture

Ops, I was not using the settings, sorry.

vasike’s picture

Status: Needs review » Needs work

2 things for the latest patch (#6)
- i wouldn't make this option default to TRUE - it affects the current implementation, and maybe it's not desired
- there is nothing to let us know the form will be/ it is submitted.
I think we need something there to tell us about what's happening.
I also could do a manual submit before the script does it job.

holist’s picture

Ruichao’s picture

This patch is based on #6.

It includes below changes:
1. auto filter option default to false.
2. changed the js handler to use jquery ui select handler to submit. It works with both AJAX and non-AJAX and thus works in views preview.

webdrips’s picture

#9 broke all views filters for me...seems to have removed "Remember the last selection
Enable to remember the last selection made by the user.", along with the checkboxes for the user roles. I had this set for some views.

#8 seems to be a safer bet so far.

Edit: #8 isn't working either, and I believe it can't be used with ajax.

sandzel’s picture

I adjusted patch from #9 to work with a views that has many submit buttons.

alok.tiwari’s picture

Modified #11 to align with V. 8.x-1.7,
also defined autosubmit field to file : views_autocomplete_filters.module as the field's data wasn't getting stored while saving views.
Fixed Minor PHPCS issues.

alok.tiwari’s picture

Status: Needs work » Needs review
vasike’s picture

Version: 8.x-1.x-dev » 2.0.x-dev
Status: Needs review » Needs work

There will be no features for 8.x ... so 2.x should be considered

And unfortunately the latest one fails to apply.

vasike’s picture

Status: Needs work » Needs review

MR available - created from previous patches ... thanks to all
+ some small updates and made it green.

  • vasike committed b0f2ddae on 2.0.x
    Issue #1724278 by edurenye, holist, alok.tiwari, sandzel, victoriachan,...
vasike’s picture

and MR merged ... now the autosubmit should be available in the latest dev version

composer require 'drupal/views_autocomplete_filters:2.0.x-dev@dev'

Leave the issue in Needs review - for now - to get some feedback for the "results".

thanks to all for the efforts on this.

vasike’s picture

Status: Needs review » Fixed

Tests added that covers this ... so we should be covered.
+ New release which includes this ... so Fixed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.