Skip to content

Commit

Permalink
rename methods
Browse files Browse the repository at this point in the history
  • Loading branch information
sanchezzzhak committed Jan 19, 2016
1 parent 017eb21 commit 8d84af6
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions GridView.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@ class GridView extends \yii\grid\GridView

public $paginationPageSize = [20,50,100,300];

public $menuColumns = true;
public $menuColumns = true;
//public $resizeColumn = true;

public $menuColumnsBtnLabel = 'Show / hide columns';

public $toolbar = [
//{menu} {pageSize}
'default' => '
<div class="btn-group pull-left">{pageSize}</div>
<div class="btn-group pull-right">{menu}</div>
Expand All @@ -46,7 +47,7 @@ public function init()

public function run()
{
$this->prepareShowHideColumns();
$this->prepareVisibilityColumns();
echo Html::beginTag('div',['class' => 'kak-grid']);
parent::run();
echo Html::endTag('div');
Expand All @@ -57,7 +58,7 @@ public function renderActions()
return '';
}

public function renderPaginationPageSize()
public function renderPageSize()
{
if (!$this->paginationPageSize || !count($this->paginationPageSize)) {
return '';
Expand All @@ -81,7 +82,7 @@ public function renderSection($name)
case '{toolbar}':
return $this->renderToolbar();
case '{pageSize}':
return $this->renderPaginationPageSize();
return $this->renderPageSize();
case '{actions}':
return $this->renderActions();
}
Expand Down Expand Up @@ -138,7 +139,7 @@ public function renderTableRow($model, $key, $index)



protected function prepareShowHideColumns()
protected function prepareVisibilityColumns()
{
$key = 'kak-grid_'.$this->id;
if(count($this->columns) > 0 && $this->menuColumns && isset($_COOKIE[$key])){
Expand Down Expand Up @@ -259,9 +260,9 @@ public function renderFilters()
$cells[] = $column->renderFilterCell();
}
return Html::tag('tr', implode('', $cells), $this->filterRowOptions);
} else {
return '';
}

return '';
}


Expand Down

0 comments on commit 8d84af6

Please sign in to comment.