Example #1
0
?>

    <script>
    </script>

    <?php 
echo ' <div id=searchNama> <label class="control-label">Search By Nama</label>';
echo Typeahead::widget(['name' => 'FormSearchReport[nama_mahasiswa]', 'options' => ['placeholder' => 'Ketik Nama Mahasiswa', 'id' => 'nameMhs'], 'scrollable' => true, 'pluginOptions' => ['highlight' => true], 'dataset' => [['prefetch' => Url::to(['request/mahasiswalist']), 'limit' => 10]], 'pluginEvents' => ['typeahead:selected' => 'function() {
                $("#kelasDropDown").attr("disabled" , true);
                $("#kelasDropDown").attr("value" , "");
                }']]);
echo '</div>';
?>

    <?php 
echo Form::widget(['model' => $model, 'form' => $form, 'columns' => 4, 'attributes' => ['kelas' => ['label' => 'Search By Kelas', 'type' => Form::INPUT_DROPDOWN_LIST, 'items' => ArrayHelper::map(AitkRKelas::find()->all(), 'kelas_id', 'kode_kelas'), 'options' => ['id' => 'kelasDropDown', 'prompt' => '---', 'onchange' => '
                        var val =(this.value);
                        if(val!="") {
                        $("#nameMhs").attr("disabled", true);
                        }
                        else {
                        $("#nameMhs").attr("disabled", false);
                        }           
                    ']]]]);
?>

    <div class="form-group">
        <?php 
echo Html::submitButton('Search', ['class' => 'btn btn-primary']);
?>
    </div>