Giter Club home page Giter Club logo

grid-page-size's Introduction

Grid page size extension for yii 2 gridview

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist webvimark/grid-page-size "*"

or add

"webvimark/grid-page-size": "*"

to the require section of your composer.json file.

Configuration

If input in GridView

<?=  webvimark\extensions\GridPageSize\GridPageSize::widget([
        'pjaxId'=>'role-grid-pjax',
]) ?>

<?php yii\widgets\Pjax::begin([
        'id'=>'role-grid-pjax',
]) ?>

<?= yii\grid\GridView::widget([
	'id'=>'role-grid',
	'dataProvider' => $dataProvider,
	'pager'=>[
		'options'=>['class'=>'pagination pagination-sm'],
		'hideOnSinglePage'=>true,
		'lastPageLabel'=>'>>',
		'firstPageLabel'=>'<<',
	],
	'filterModel' => $searchModel,
	'layout'=>'{items}<div class="row"><div class="col-sm-8">{pager}</div><div class="col-sm-4 text-right">{summary}'.webvimark\extensions\GridBulkActions\GridBulkActions::widget([
				'gridId'=>'role-grid',
				'actions'=>[ yii\helpers\Url::to(['bulk-delete'])=>webvimark\extensions\GridBulkActions\GridBulkActions::t('app', 'Delete'),],
			]).'</div></div>',
	'columns' => [
		['class' => 'yii\grid\SerialColumn', 'options'=>['style'=>'width:10px'] ],
		[
			'attribute'=>'description',
			'value'=>function(Role $model){
					return yii\helpers\Html::a($model->description, ['view', 'id'=>$model->name], ['data-pjax'=>0]);
				},
			'format'=>'raw',
		],
		'name',
		['class' => 'yii\grid\CheckboxColumn', 'options'=>['style'=>'width:10px'] ],
		[
			'class' => 'yii\grid\ActionColumn',
			'contentOptions'=>['style'=>'width:70px; text-align:center;'],
		],
	],
]); ?>

<?php yii\widgets\Pjax::end() ?>

grid-page-size's People

Contributors

webvimark avatar macagua avatar stunc0 avatar padlyuck avatar johny011409 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.