Coder Social home page Coder Social logo

yii2-widget-linkpager's Introduction

yii2-widget-linkpager

LinkPager widgets for Yii Framework 2.0

Increase the pageSize of the page drop-down box Effect picture 1
Effect picture 2

Installation

The preferred way to install this extension is through composer.

Either run

 composer require --prefer-dist liyunfang/yii2-widget-linkpager

or add

"liyunfang/yii2-widget-linkpager": "*"

to the require section of your composer.json file.

Requirements

This extension require twitter-bootstrap

Usage

Once the extension is installed, simply use it in your code by :

GridView options

    'filterSelector' => "select[name='".$dataProvider->getPagination()->pageSizeParam."'],input[name='".$dataProvider->getPagination()->pageParam."']",
    'pager' => [
        'class' => \liyunfang\pager\LinkPager::className(),
        //'template' => '{pageButtons} {customPage} {pageSize}',
        //'pageSizeList' => [10, 20, 30, 50],
        //'pageSizeMargin' => 'margin-left:5px;margin-right:5px;',
        //'pageSizeOptions' => ['class' => 'form-control','style' => 'display: inline-block;width:auto;margin-top:0px;'];
        //'customPageWidth' => 50,
        //'customPageBefore' => ' Jump to ',
        //'customPageAfter' => ' Page ',
        //'customPageMargin' => 'margin-left:5px;margin-right:5px;',
        //'customPageOptions' => ['class' => 'form-control','style' => 'display: inline-block;margin-top:0px;'];
    ],

ModelSearch

    public function search($params)
    {
        ...
        $pageSize = isset($params['per-page']) ? intval($params['per-page']) : 10;
        $dataProvider = new ActiveDataProvider([
            'query' => $query,
            'pagination' =>  ['pageSize' => $pageSize,],
        ]);
        

2015-09-16 重构代码,增加自定义跳转页面文本框

yii2-widget-linkpager's People

Contributors

pgyf avatar

Watchers

James Cloos avatar Chen,Yongze 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.