Skip to content

Commit

Permalink
Merge pull request #1 from hello-omny/dev
Browse files Browse the repository at this point in the history
Added option for wrapping content table.
  • Loading branch information
sanchezzzhak authored Jan 24, 2017
2 parents 8d84af6 + 882d230 commit 5e34a02
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
13 changes: 12 additions & 1 deletion GridView.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ class GridView extends \yii\grid\GridView

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

/**
* @var null|string
*/
public $tableWrapperClass = null;

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

Expand Down Expand Up @@ -286,7 +291,13 @@ public function renderItems()
$tableFooter
]);

return Html::tag('table', implode("\n", $content), $this->tableOptions);
$contentTable = Html::tag('table', implode("\n", $content), $this->tableOptions);

if (!is_null($this->tableWrapperClass)) {
$contentTable = Html::tag('div', $contentTable, ['class' => $this->tableWrapperClass]);
}

return $contentTable;
}

/**
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Once the extension is installed, simply use it in your code by :
'paginationPageSize' => [20,50,100], // is empty array hide control
'menuControl' => true, // Show menu control
'menuColumnsBtnLabel' => 'Show / hide columns',
'tableWrapperClass' => 'table table-responsive', // Wrapper class for table, if not defined not rendered.
'showFooter' => true,
'toolbar' => [
'default' => ''
Expand Down

0 comments on commit 5e34a02

Please sign in to comment.