Questions tagged [select2]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
2
votes
0answers
69 views

How do you select a value of an EntityRef Select2 using jQuery?

I have a scenario where a user selects a row of data to edit and I want an EntityRef Select2 box to be populated with a piece of information from that row. The EntityRef select2 widget works for ...
0
votes
1answer
22 views

Why doesn't anything happen when I select a search action from the CiviCRM search results?

I'm in CiviCRM 5.5.0 and everything works perfectly - except that nothing happens when I select a search action like "Add an activity". There are no errors in the Javascript console. What's ...
1
vote
2answers
453 views

How to listen to country select change

How can I listen in JavaScript to the event of a country value change on the country select field? both #select2-drop-mask and #select2-drop are not available until the user clicks to open the select....
2
votes
1answer
1k views

How can I trigger a selection for a Select2 EntityRef element via javascript?

The CiviCRM EntityRef form element uses a Select2 select box to make lots of CiviCRM forms more awesome. A user can, for example, search for contacts to choose one. Great. I am building an extension ...
1
vote
0answers
1k views

ngChange event fired twice when using multi-select with crmUiSelect

I'm trying to use CiviCRM's crmUiSelect AngularJS directive to create a select2 element in a form. I want to call a function in my controller when the user changes this element, so I'm using the ...
0
votes
1answer
593 views

Multi-select not working with crmUiSelect AngularJS select2 directive

I created a select2 element with CiviCRM's crmUiSelect AngularJS directive by using the following code in my controller: $scope.options = [ {"value": "foo", "label": "Foo"}, {"value": "bar", "...
3
votes
3answers
30k views

How to select multiple values in select2 control by jquery?

I want to select multiple options in a select2 multivalue control, when clicking a button. This is useful specially for searches where the user needs to select many option to one of the filters any ...
3
votes
2answers
3k views

Setting Select2 widths

We have a number of forms that have items on them using the built in Select2 support. They aren't quite wide enough; annoyingly so. For the default selection, you can see the membership type and the ...
3
votes
1answer
483 views

How do you visually update a select2 widget?

I'm trying to select the value of a select2 widget using js. I can change the value ok: jQuery('#excludeGroups').val("846").trigger("change"); The problem I'm having is that this doesn't update the ...