Skip to content

Commit

Permalink
Add sorter and per page functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
tafid committed Aug 12, 2015
1 parent fb6bc96 commit 5137122
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 14 deletions.
9 changes: 4 additions & 5 deletions src/views/account/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
Pjax::begin(array_merge(Yii::$app->params['pjax'], ['enablePushState' => true]));

echo Html::beginForm();
$box = ActionBox::begin(['model' => $model, 'bulk' => true, 'options' => ['class' => 'box-info']]);
$box = ActionBox::begin(['model' => $model, 'dataProvider' => $dataProvider]);
$box->beginActions();
?>
<div class="dropdown">
Expand All @@ -30,13 +30,12 @@
<span class="caret"></span>
</button>
<?= $box->renderSearchButton(); ?>
<?= LinkSorter::widget([
'show' => true,
'sort' => $dataProvider->getSort(),
<?= $box->renderSorter([
'attributes' => [
'login', 'client', 'server', 'state', 'type'
],
]); ?>
]) ?>
<?= $box->renderPerPage() ?>
<?= \yii\bootstrap\Dropdown::widget([
'items' => [
['label' => Yii::t('app', 'Create {modelClass}', ['modelClass' => 'account']), 'url' => ['create']],
Expand Down
12 changes: 6 additions & 6 deletions src/views/db/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@

Pjax::begin(array_merge(Yii::$app->params['pjax'], ['enablePushState' => true]));

$box = ActionBox::begin(['model' => $model, 'options' => ['class' => 'box-info']]);
$box = ActionBox::begin(['model' => $model, 'dataProvider' => $dataProvider]);
$box->beginActions();
print $box->renderCreateButton(Yii::t('app', 'Create {modelClass}', ['modelClass' => 'DB'])) . '&nbsp;';
print $box->renderSearchButton();
echo LinkSorter::widget([
'show' => true,
'sort' => $dataProvider->getSort(),
print $box->renderSearchButton(); ?>
<?= $box->renderSorter([
'attributes' => [
'client', 'account', 'server', 'name', 'description', 'state'
],
]);
]) ?>
<?= $box->renderPerPage() ?>
<?php
$box->endActions();

$box->beginBulkActions();
Expand Down
16 changes: 13 additions & 3 deletions src/views/hdomain/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,21 @@


echo Html::beginForm();
$box = ActionBox::begin(['model' => $model, 'options' => ['class' => 'box-info']]);
$box = ActionBox::begin(['model' => $model, 'dataProvider' => $dataProvider]);
$box->beginActions();
print $box->renderCreateButton(Yii::t('app', 'Create {modelClass}', ['modelClass' => Yii::t('app', 'Domain')]));
echo '&nbsp;';
print $box->renderCreateButton(Yii::t('app', 'Create {modelClass}', ['modelClass' => Yii::t('app', 'Domain')])) . '&nbsp;';
print $box->renderSearchButton();
print $box->renderSorter([
'attributes' => [
'domain',
'client',
'seller',
'account',
'server',
'state',
],
]);
print $box->renderPerPage();
$box->endActions();

$box->beginBulkActions();
Expand Down

0 comments on commit 5137122

Please sign in to comment.