Created
August 14, 2016 18:00
-
-
Save LANSELOT/d928bc303b8575f8a289ca017efac29f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use yii\widgets\Pjax; | |
use yii\widgets\PjaxAsset; | |
PjaxAsset::register($this); | |
$this->registerJs(<<<JS | |
$(document).on('change', '#provider', function(e) { | |
$.pjax({ | |
timeout: 4000, | |
url: $('#filter-form').attr('action'), | |
container: '#list-view', | |
fragment: '#list-view', | |
data: {provider: this.options[this.selectedIndex].value}, | |
}); | |
}); | |
JS | |
, yii\web\View::POS_END); | |
<?=Html::beginForm(Url::current(), 'GET', ['id'=>'filter-form']);?> | |
<?=Html::activeDropDownList($model, 'provider', Provider::items(), ['id'=>'provider']); ?> | |
<?=Html::endForm(); ?> | |
<?php \yii\widgets\Pjax::begin(); ?> | |
<?= \yii\widgets\ListView::widget([.....]) ?> | |
<?php \yii\widgets\Pjax::end(); ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment