hello,

the search seems to work with "Start with" and not with "Contains" ...

is it possible to change this somewhere?

thanks

Comments

Cyclodex’s picture

I also need this for my project, so this is a simple option you can pass to chosen.
.chosen({search_contains: true})
(Somehow this is not documented as I see)
But there is a closed issue:
https://github.com/harvesthq/chosen/issues/288

I could make a patch soon, to give this feature as an option in the chosen settings.

[Beep] Cyclodex

Cyclodex’s picture

Status: Active » Needs review
StatusFileSize
new2.18 KB

Adding a patch which enables the possibility to set an option in the chosen settings, to search also in the middle of words.

Apply this patch against the current dev version.
Not sure how to process here, because this module/maintainer seems to be not that active anymore.

Would like to see such improvements and others in a new version.

sachbearbeiter’s picture

thanks a lot - i will test ...

Cyclodex’s picture

any feedback? :)

shadcn’s picture

Testing this...

dynamicdan’s picture

This patch would bring us one step closer to using this field for hierarchical taxonomy selection.
The next step would be to show the parents in brackets next to the results.. eg:

(regions taxonomy)

-Melbourne (USA/Florida)
-Melbourne (Australia/Victoria)

BTW, Anyone know how to kick a maintainer back into life?

shadcn’s picture

I committed this to the dev branch. @cyclodex, can you run some tests? http://drupal.org/node/1223156/commits

dynamicdan’s picture

I checked out that source.. seems to work fine.

Not sure if the first item in the list should show the text for which the search matches though..
Eg,

search: dev

Expected results:
1 Got some1todev (not viewable/obvious)
2 Eat my Cooldev (works)

Probably simply due to the fact that the first item is always selected/highlighted by default meaning one won't see the matched text in the first result.

Cyclodex’s picture

Sorry quite busy over here ;)

Will test your commits soon, thanks!

Cyclodex’s picture

@dynamicdan
What do you mean exactly ?

dynamicdan’s picture

StatusFileSize
new16.4 KB
new11.19 KB

Attached demos. The 2nd is more obvious. I type 'ice' but I don't know where in the first result it matches with 'ice'.

Cyclodex’s picture

Ah you mean because it is already selected (blue background).

Looks like this is the basic behavior of this plugin. So I guess it would be nice if you create an issue over there, on their github.

Not sure if we should try to fix this, because as I said, this comes with the plugin we use.

dynamicdan’s picture

Cyclodex’s picture

Assigned: Unassigned » Cyclodex
Status: Needs review » Fixed

thanks @ dynamicdan

Ok, it looks like we can close this issue, because this is now implemented and works.
The other issues are related to chosen library or should get new dedicated issue:

@ dynamicdan, can you do this, thanks :)

(regions taxonomy)

-Melbourne (USA/Florida)
-Melbourne (Australia/Victoria)
dynamicdan’s picture

@Cyclodex, already done:
http://drupal.org/node/1614264

Cyclodex’s picture

Great! Sorry, I am just cleaning up this issue list ;) There are a lot of them, but I want to track this down in the next days/weeks :)

Status: Fixed » Closed (fixed)

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

filsterjisah’s picture

+1

filsterjisah’s picture

Added patch based on #2 for 7.x-1.0 version (not dev release) for those who need it.