Вот и прошу помощи, так как у самого добраться до сути не получается.
Обычный селект я нашел и запилил, он работает, но не красиво смотрится
Код: Выделить всё
<select class="form-control" style="width: 70px; margin-top: 5px" onchange="location = this.value;">
<?php foreach ($values as $value): ?>
<option value="<?= Html::encode(Url::current(['per-page' => $value, 'page' => null])) ?>"
<?php if ($current == $value): ?>
selected="selected"
<?php endif; ?>>
<?= $value ?>
</option>
<?php endforeach; ?>
</select>
Код: Выделить всё
'summary' => 'Показано <b> '.Select2::widget([
'model' => $searchModel,
'attribute'=>'name',
'theme' => Select2::THEME_DEFAULT,
'data' => [20, 30, 50, 100, 'Все'],
'pluginEvents'=>[
"select2:select" => 'function() { $("#w2").submit();}',
// 'select2:select\\'=> new \yii\web\JsExpression("function(){console.log(\\'here\\')}"),
],
'options' => [
'placeholder' => '--20--',
],
'pluginOptions' => [
'allowClear' => true,
'width' => 'auto',
'margin' => '5px'
]
]). '</b> записей <b>{begin, number}-{end, number}</b> из <b>{totalCount, number}</b>.',