2017 © Pedro Peláez
 

yii2-extension yii2-datatables

yii2 Datatables

image

xinyeweb/yii2-datatables

yii2 Datatables

  • Wednesday, January 17, 2018
  • by hotarzhang
  • Repository
  • 2 Watchers
  • 0 Stars
  • 1 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

yii2-datatables

yii2 Datatables, (*1)

Installation

The preferred way to install this extension is through composer., (*2)

Either run, (*3)

php composer.phar require --prefer-dist xinyeweb/yii2-datatables "*"

or add, (*4)

"xinyeweb/yii2-datatables": "*"

to the require section of your composer.json file., (*5)

Usage

Once the extension is installed, simply use it in your code by :, (*6)

= DataTables::widget([
    'dataProvider' => $dataProvider,
    'filterModel' => $searchModel,
    'columns' => [
        ['class' => 'yii\grid\SerialColumn'],

        //columns

        ['class' => 'yii\grid\ActionColumn'],
    ],
]);?>

Client

'clientOptions' => [
    "lengthMenu"=> [[20,-1], [20,Yii::t('app',"All")]],
    "info"=>false,
    "responsive"=>true, 
    "dom"=> 'lfTrtip',
    "tableTools"=>[
        "aButtons"=> [  
            [
            "sExtends"=> "copy",
            "sButtonText"=> Yii::t('app',"Copy to clipboard")
            ],[
            "sExtends"=> "csv",
            "sButtonText"=> Yii::t('app',"Save to CSV")
            ],[
            "sExtends"=> "xls",
            "oSelectorOpts"=> ["page"=> 'current']
            ],[
            "sExtends"=> "pdf",
            "sButtonText"=> Yii::t('app',"Save to PDF")
            ],[
            "sExtends"=> "print",
            "sButtonText"=> Yii::t('app',"Print")
            ],
        ]
    ]
],

The Versions

17/01 2018

dev-master

9999999-dev

yii2 Datatables

  Sources   Download

BSD-3-Clause

The Requires

  • yiisoft/yii2 ~2.0.0
  • bower-asset/datatables >= 1.9.4
  • bower-asset/datatables-bootstrap3 *
  • bower-asset/datatables-tabletools *

 

by horer

extension yii2