Home › Forums › Calendar Products › Events Calendar PRO › Venue dropdown search using wildcard
- This topic has 5 replies, 4 voices, and was last updated 9 years, 2 months ago by
Eric.
-
AuthorPosts
-
January 17, 2017 at 1:43 am #1219509
Eric
ParticipantHi,
I’m having the following problem, the search for the venue is not wildcard, is it possible to change that?
See also https://screencast.com/t/RcSoZ1k3poj
Eric
January 17, 2017 at 4:39 pm #1219962Brook
ParticipantHowdy again Eric,
I would love to help you find a solution for this, as best I can.
This is likely possible to do. The jQuery plugin which powers that dropdown/search is called Select2. As of Select2 version 4.0 the search function can be modified. Here is an example modification that likely works exactly like you want. The problem is that we are using Select2 version 3.5.
You or your PHP developer could dequeue our version of Select2 and enqueue a newer version of it, such as 4.0. From there following this example you could swap out the “matcher” algorithm for one of your own, likely you would be happy just copying the one from that example.
Does that make sense?
Cheers!
– Brook
January 25, 2017 at 1:07 am #1223446Eric
ParticipantHi Brook,
Thanks for the reply, but I still have a question.
Why is it that if I have the following options in the venue dropdown:
Option A
Option BAnd I search for ‘on A’ I don’t get this match
Option A
Option BBut I have to search for ‘Option A’
—-
For your solution, where is the hook that I can dequeue the Select2 version of tribe events. And where can I find the init for the venue dropdown (i.e. which js file)Eric
January 25, 2017 at 11:32 pm #1224188Brook
ParticipantHowdy again Eric!
Why is it that if I have the following options in the venue dropdown:
Option A
Option BAnd I search for ‘on A’ I don’t get this match
Simply put: because the third party library our plugin uses, Select 2, does not work that way. By default it searches from the beginning of the full string.
For your solution, where is the hook that I can dequeue the Select2 version of tribe events. And where can I find the init for the venue dropdown (i.e. which js file)
You could use any of the hooks people commonly use for dequeueing. For example, ‘wp_print_scripts’ is a well-timed action for this sort of thing. The script handle you want to dequeue and possible deregister is ‘tribe-select2’. From there you can create your own.
Cheers!
– Brook
February 16, 2017 at 8:35 am #1238768Support Droid
KeymasterHey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.
Thanks so much!
The Events Calendar Support Team -
AuthorPosts
- The topic ‘Venue dropdown search using wildcard’ is closed to new replies.
