$form2 = ActiveForm::begin([
'id' => 'prosto-form2',
'options' => ['style' => 'border:1px;'],
]);
echo "<label>Фильтр по критерию:</label>";
echo Select2::widget([
'name' => 'modelSearchService',
'model' => 'modelSearchService',
'value'=>$serviceFilter,
'data' => $servicelist,
'options' => ['placeholder' => 'Select account ...'],
'pluginOptions' => [
'allowClear' => true,
'width' => '200px'
],
'pluginEvents' => [
'change' => 'function() {
$("#prosto-form2").attr("action", $("#prosto-form2").attr("action").replace(/page=[0-9]+/, ""));
$("#prosto-form2").attr("action", $("#prosto-form2").attr("action").replace(/filter=[a-zA-Z0-9_\-\s]+/, "filter=" + $("#prosto-form2 select[name=modelSearchService] option:selected").val()));
$("#prosto-form2").submit();
}'
]
]);
ActiveForm::end()
$form2 = ActiveForm::begin([
'id' => 'prosto-form2',
'options' => ['style' => 'border:1px;'],
]);
echo "<label>Фильтр по критерию:</label>";
echo Select2::widget([
'name' => 'modelSearchService',
'model' => 'modelSearchService',
'attribute' => 'state_2',
'data' => $servicelist,
'options' => ['placeholder' => 'Select account ...'],
'pluginOptions' => [
'allowClear' => true,
'width' => '200px'
],
'pluginEvents' => [
'change' => 'function() {
$("#prosto-form2").submit();
}'
]
]);
ActiveForm::end()
'components' => [
// connect to MSSQL
'db' => [
'class' => 'yii\db\Connection',
'dsn' => 'dblib:host=MMPS_Common;dbname=MMPS_Common;charset=UTF-8',
....
'charset' => 'utf8',
],