Closed (fixed)
Project:
Views Autocomplete Filters
Version:
6.x-1.x-dev
Component:
Code
Priority:
Major
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
6 Apr 2011 at 11:26 UTC
Updated:
2 May 2011 at 07:32 UTC
Hi,
all the options displayed by the autocomplete widget are all the present options in the resoults but when writting in the exposed field the number of results doesn't reduce.
I propouse a hack that works for me, what do you think about?
At file views_autocomplete_filters.inc add a condition in the if inside foreach:
foreach ($view->result as $id => $row) {
// Add a class wrapper for a few required CSS overrides.
if (!empty($row->$field_alias) && strstr(drupal_strtoupper($row->$field_alias),drupal_strtoupper($string))) { //added condition
$matches[$row->$field_alias] = '<div class="reference-autocomplete">'. $row->$field_alias .'</div>';
}
}
thanks a lot for your work, really nice module!
Comments
Comment #1
teflo commentedThanks quiron!
Comment #2
vasikethanks
but this is something that could be achieved with the operator of the field, if you choose "Contains" operator and no Case sensitive in the filter definition
please let me know if i'm wrong.
Comment #3
jvdurme commentedHi there,
it doesn't work. when I choose "Contains" as operator, no matter what I type in the field, the autocomplete will show all view results and not just those that matches what is typed.
I would call this a serious drawback of what can be a really interesting module.
Comment #4
arski commentedsame issue here with the contains operator.. always shows all values (well, the first 10 sorted alphabetically it seems) regardless of what I type in :(
Comment #5
vasikeplease check the last dev : 6.x-1.x-dev
Comment #6
arski commentedthis seems to work solidly in the "Default" preview now.. sadly not in the Page preview, or on the actual page :(
Comment #7
arski commentedI'm not 100% sure, but this looks increasingly a duplicate of #1104744: Works only in live preview / default view. All the issues in here are fixed with the patch in there for me.
Comment #8
vasike