title: yii2 - How to set kartik select2 value in javascript
body: <p>I try to set value to kartik select2 in javascript action but still no luck.
  here is my code in view files:</p>
  
  <pre><code>&lt;div class="col-xs-6"&gt;
      &lt;?= $form-&gt;field($model, 'item_id')-&gt;widget(kartik\select2\Select2::className(), [
          'data' =&gt; \yii\helpers\ArrayHelper::map(\app\models\ItemProduction::find()-&gt;all(), 'id', 'name'),
          'options' =&gt; ['placeholder' =&gt; 'Select item'],
          'pluginOptions' =&gt; [
              'allowClear' =&gt; true,
          ],
      ]) ?&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>and my javascript code like this</p>
  
  <pre><code>$(document).on('click', '.select-row', function(){
      // get id from custom button
      var id = $(this).attr('data-id');
      $.get('../ticket-timbangan/get-ticket', {id : id}, function(data){
              var data = $.parseJSON(data);        
              alert(data.item_id);
              $('#pengirimanproduksi-ticket_id').val(data.id);                
              $('#select2-pengirimanproduksi-item_id-container').val(data.item_id).trigger('change');
  
              $('#pengirimanproduksi-bruto_tbg').val(data.bruto);
              $('#pengirimanproduksi-tara_tbg').val(data.tara);
              $('#pengirimanproduksi-remark').val(data.remark);
      });
      $('#modalTicketList').modal('hide');        
  });
  </code></pre>
  
  <p>this is I inspect kartik select2 element </p>
  
  <pre><code>&lt;span class="select2-selection__rendered" id="select2-pengirimanproduksi-item_id-container"&gt;&lt;span class="select2-selection__placeholder"&gt;Select item&lt;/span&gt;&lt;/span&gt;
  </code></pre>
  
  <p>I try this code <code>$('#select2-pengirimanproduksi-item_id-container').val(data.item_id).trigger('change');</code> but it changes nothing.
  Please advice. thanks.</p>