[SOLVED] Which Field Type For Multiple Choices From A List

5 years 7 months ago #307203 by bins
Just dragging this up again!

I couldn't get your suggested solution to work (down to me, I guess!), but would still like a select2 list.

Have any of the development allowed this to happen or made creating it easier?

Please Log in to join the conversation.

5 years 7 months ago #307204 by krileon
What about it isn't working? Have you followed the instructions carefully in my below reply?

www.joomlapolis.com/forum/153-professional-member-support/236285-substring-search-in-cb-query-field-how-to-get-this-method#292473

You need to use CB Auto Actions to output the necessary jQuery to force a select element to select2. I recommend using the field specific approach using the below jQuery as shown in the above topic.

$( 'select#FIELD_NAME' ).cbselect();

you will need to replace FIELD_NAME with the name of your field. As for your question in the topic it self the supplied jQuery goes in the Code parameter.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

5 years 7 months ago - 5 years 7 months ago #307253 by bins
I have done the:

Global
Triggers: onBeforeRegisterFormDisplay, onBeforeUserProfileEditDisplay
Type: Code
User: Automatic
Access: Everybody

Action
Method: jQuery
Code:
$( 'select#FIELD_NAME' ).cbselect(); << #FIELD_NAME = Cb Field Name for the selector>>


Not sure where this goes - I have it in the select field under the tab integrations/cb code field:
Plugins: cbselect
To apply to all select fieldtypes you'd use the below.
$( '.cbft_select select,.cbft_multiselect select,.cbft_queryselect select,.cbft_querymultiselect select'

Please Log in to join the conversation.

5 years 7 months ago #307255 by krileon
You're missing the jQuery plugin usage. You need to be using exactly the below in your Code action.

Global
Triggers: onBeforeRegisterFormDisplay, onBeforeUserProfileEditDisplay
Type: Code
User: Automatic
Access: Everybody
Action
Method: jQuery
Code:
$( 'select#FIELD_NAME' ).cbselect();
Plugins: cbselect

The only thing you'll need to change is replace FIELD_NAME with the actual name of your field. For example if the name of my field is cb_select I'd use the below. Note if the select is a multiselect then you need to add __ after the field name.

$( 'select#cb_select' ).cbselect();

You can try the below instead if that's not working for you.

$( '#cbfr_FIELD_ID select' ).cbselect();

Replace FIELD_ID with the ID of your field. I've confirmed both of the above usages are working fine.

Not sure where this goes - I have it in the select field under the tab integrations/cb code field:

Please read the topic carefully. It says to use that code instead of the code above it if you want the select2 usage to apply to all select fieldtypes instead of a specific field.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
The following user(s) said Thank You: bins

Please Log in to join the conversation.

5 years 7 months ago #307257 by bins
After a lot of random playing, I swapped $( 'select#cb_select' ).cbselect(); for $( '#cbfr_FIELD_ID select' ).cbselect(); and it now works.

Thanks!

Now I need to find out why I cannot search in a member list by an selection

Please Log in to join the conversation.

5 years 7 months ago #307262 by bins
Search has started working!

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.228 seconds

Facebook Twitter LinkedIn