Skip to content

Instantly share code, notes, and snippets.

@jsivakumaran
Created June 22, 2016 23:59
Show Gist options
  • Save jsivakumaran/594a57b80706325dcc6837d74c291495 to your computer and use it in GitHub Desktop.
Save jsivakumaran/594a57b80706325dcc6837d74c291495 to your computer and use it in GitHub Desktop.
<?php
$membershipFee = ArrayHelper::map(Fee::find()->joinWith('feeLists')->where(['fee_list_id'=>$membership->fee_list_id])->orderBy('name')->all(), 'id', 'name');
// echo $form->field($memberEnroll, 'id[]',['inputOptions' => ['class' => 'form-control','id'=>'fee-id','tabindex'=>4]])->dropDownList($membershipFee)->label('Membership Fee');
echo Select2::widget([
'model' => $memberEnroll,
'attribute' => 'id[]',
'data'=> ArrayHelper::map($fees, 'id', 'name'),
'options' => [
'placeholder' => 'Select Complex ...', 'multiple' => false,
'class' => 'col-md-3',
'id'=> 'fee-id' //this is the key
],
'pluginOptions' => [
'allowClear' => true,
],
]);
?>
var fee_id = $('#fee-id').val(); //the jquery
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment