<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Efficy Overflow Q&amp;A - Recent questions tagged select2</title>
<link>https://overflow.efficy.io/?qa=tag/select2</link>
<description>Powered by Question2Answer</description>
<item>
<title>How to activate Ajax call on select2 attached to a &lt;select&gt; element ?</title>
<link>https://overflow.efficy.io/?qa=6741/how-to-activate-ajax-call-on-select2-attached-select-element</link>
<description>&lt;p&gt;Dear all,&lt;/p&gt;

&lt;p&gt;I am trying to build a &lt;code&gt;&amp;lt;select&amp;gt;&lt;/code&gt; with the &quot;select2&quot; component in order to search data from a Macro in a asynchronous mode because I am searching data to another entity. &lt;/p&gt;

&lt;p&gt;I now that in standard I can use the definition &lt;code&gt;LOOKUPDROPDOWNSEARCH&lt;/code&gt; but by doing so I forced to overwrite the &lt;code&gt;pages/dropdown/ListSearch.htm&lt;/code&gt; in order to pass the Macro I needed to load the data + I need to override the &lt;code&gt;editDetailCmd.js&lt;/code&gt; to pass this macro to the page. which is very not convenient.&lt;/p&gt;

&lt;p&gt;I wanted at first use the &lt;code&gt;&quot;data-ajax-url&quot;&lt;/code&gt; attribut, but it seems we are not allowed to do so on HTML &lt;code&gt;&amp;lt;select&amp;gt;&lt;/code&gt; tag, at least with the select2 library version we have in Efficy Entreprise which is version 3.5.2. &lt;/p&gt;

&lt;p&gt;If we try to use it we got the following error : &lt;/p&gt;

&lt;pre&gt;&lt;code&gt;select2.js?ist=20221004215237&amp;amp;c=202210311518:947 Uncaught Error: Option 'ajax' is not allowed for Select2 when attached to a &amp;lt;select&amp;gt; element.
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;And I don't want to use an HTML &lt;code&gt;&amp;lt;input&amp;gt;&lt;/code&gt; tag like it is used in standard for PostCode/City field since the value that I will store will be a key not a text.&lt;/p&gt;
</description>
<category>Efficy/ Client side</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=6741/how-to-activate-ajax-call-on-select2-attached-select-element</guid>
<pubDate>Mon, 31 Oct 2022 16:36:19 +0000</pubDate>
</item>
<item>
<title>Refresh of SELECT not working</title>
<link>https://overflow.efficy.io/?qa=1166/refresh-of-select-not-working</link>
<description>&lt;p&gt;I'm trying to fill in the value of a select for COUNTRY in a category with the value coming from the normal Country field.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$(&quot;#CATEGORY-COMP$ADDRESS-F_V_LAND&quot;).val($(&quot;#COUNTRY&quot;).val());
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This works and is visible after the apply.&lt;br&gt;
but I want to show this directly so it's clear for the user.&lt;br&gt;
Other fields show directly the changes but the select(2) does not.&lt;/p&gt;

&lt;p&gt;I thought to solve this with the following ( which has worked before on other fields ) :&lt;/p&gt;

&lt;pre&gt;&lt;code&gt; $(&quot;#CATEGORY-COMP$ADDRESS-F_V_LAND&quot;).trigger(&quot;change&quot;);
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;But no result.&lt;/p&gt;

&lt;p&gt;So the Question :&lt;br&gt;
How do I refresh the displayed value ?&lt;/p&gt;
</description>
<category>Efficy/ Client side</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=1166/refresh-of-select-not-working</guid>
<pubDate>Tue, 12 Jan 2016 11:36:57 +0000</pubDate>
</item>
<item>
<title>Efficy 2014 Select2 How to hide options in the list</title>
<link>https://overflow.efficy.io/?qa=784/efficy-2014-select2-how-to-hide-options-in-the-list</link>
<description>&lt;p&gt;I wanted to know how to hide some options in the select2 depending of another option selected from another select?&lt;/p&gt;
</description>
<category>Efficy/ Client side</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=784/efficy-2014-select2-how-to-hide-options-in-the-list</guid>
<pubDate>Wed, 23 Sep 2015 12:03:36 +0000</pubDate>
</item>
</channel>
</rss>