标签: paginator

如何在角度材料中自定义 mat-paginator

我想自定义 mat-paginator 。默认情况下,我得到这样的分页器,它在下面的链接https://material.angular.io/components/paginator/overview 中给出 。但我想要如下图所示的分页。我如何使用mat-paginator做到这一点

在此处输入图片说明

任何人都可以帮我解决这个问题。

paginator angular-material

16
推荐指数
3
解决办法
3万
查看次数

如何在Django-CMS插件中访问请求对象?

我有一个Django-CMS插件,用于显示对象列表.插件所需的功能是列表是分页的,可以根据列表中对象的属性重新排序.

在这种特殊情况下使用ajax处理这个功能并不是一个理想的解决方案,因此我计划使用django Paginator,它需要一个'page'查询字符串参数,并传递一个'order'查询字符串参数,我将用它来定义顺序查询集.

问题是我无法看到从插件渲染功能中访问请求对象.

有谁知道是否可以从渲染功能中访问请求对象,或者可以建议一个解决方法?

django plugins paginator request django-cms

14
推荐指数
1
解决办法
3823
查看次数

为什么当我转到第2页时,paginator还没有记住我的自定义参数?

在cakephp视图中使用paginator helper时,它不会记住为我的useage定制的url部分.

例如:

http://example.org/users/index/moderators/page:2/sort:name/dir:asc
Run Code Online (Sandbox Code Playgroud)

这里的主持人是一个帮助我按该类型过滤的参数.但是按下分页器链接将不包括此链接.

pagination cakephp paginator

12
推荐指数
2
解决办法
7403
查看次数

如何实现不调用count(*)的paginator

我正在一个拥有MySQL innodb后端的django网站上工作.我们在几个表中有数十万条记录,这导致了管理员的一些站点稳定性/性能问题.具体来说,django喜欢在创建分页器时进行count(*)查询,这会导致很多问题.

使用Django 1.3.x,他们开始允许提供自定义分页类.所以,我有兴趣找到一种方法来适当加快或消除这些查询.到目前为止,我一直在查看这两个页面:http ://code.google.com/p/django-pagination/source/browse/trunk/pagination/paginator.py https://gist.github.com/ 1094682 并没有真正发现它们是我正在寻找的.任何建议,帮助等.非常感谢.

django admin paginator

11
推荐指数
1
解决办法
2990
查看次数

CakePHP 3.0中虚拟字段/实体属性上的分页排序链接

我想在CakePHP 3.0中的虚拟字段/实体属性上创建分页排序链接.

在CakePHP 2.x中,我曾经创建一个虚拟字段,然后在该字段上创建一个分页排序链接.但是,在CakePHP 3.0中,虚拟字段已被虚拟实体属性替换.

我有什么方法可以在CakePHP 3.0中使用它吗?

在我的情况下,我有一个first_name和last_name列,它们在虚拟实体属性中组合为full_name .我想对full_name进行排序.

virtual pagination cakephp paginator jquery-ui-sortable

8
推荐指数
1
解决办法
3482
查看次数

Cake Php paginator问题

我正面临一个问题.我已经编写了分页代码.一切都按预期工作,但只有条件不起作用(只有特定条件)这是我的分页代码.

//declaration 
public $paginate = array(
        'limit' => 50,
        'paramType' => 'querystring'
    ); 
//use in action
$this->paginate['ApiLog'] = array('limit' => 50, 'order' => 'ApiLog.id DESC', 'paramType' => 'querystring');

$this->paginate['ApiLog']['conditions'] = array('ApiLog.log_type' => 2);
$this->paginate['ApiLog']['joins'] = array(               
            array(
                'table' => 'users',
                'alias' => 'User',
                'type' => 'LEFT',
                'conditions' => array('User.id = ApiLog.user_id')
            )                
        );
$this->Paginator->settings = $this->paginate['ApiLog'];
$apilogs = $this->Paginator->paginate('ApiLog');
Run Code Online (Sandbox Code Playgroud)

此代码在开发环境中工作并且返回类型为2的日志,但在生产中它只返回类型为1的日志.我花了一整天时间来找出问题.如果我确实添加任何其他条件conditions array确实生效但不生效log_type.我打印查询日志,where clause总是显示log_type = '1' 我已经清除了缓存.任何帮助表示感谢,谢谢.

php pagination cakephp paginator cakephp-2.0

8
推荐指数
1
解决办法
254
查看次数

Paginate Django formset

我有一个模型formset,我想使用Django的Paginator一次显示10个表单,但它不能像paginator = Paginator(formset, 10).如果有办法,这样做的正确方法是什么?

python django paginator formsets

7
推荐指数
1
解决办法
4786
查看次数

Cakephp 3.x另一个模型的排序不起作用

我有两个模型用户和角色

这里"Roles hasMany Users"和"Users areTo Roles"

当用户保存时,我们还要求保存用户的角色和记录.

问题: 我有列firstname,lastname,roles的用户列表.每个列和每个列都有排序,但角色排序不起作用.

角色表包含​​角色名称的"名称"字段.我在下面提到了链接,但它对我不起作用. Pagination在Cakephp 3.x中排序

UsersController:

public function index() {
     $this->paginate = [
                'contain' => ['Roles'],
                'conditions' => [
                    'Users.user_type <>' => 1
                ]
            ];

            $this->set('users', $this->paginate($this->Users));
            $this->set('_serialize', ['users']);
}
Run Code Online (Sandbox Code Playgroud)

index.ctp

 <tr>
                <th><?php echo $this->Paginator->sort('firstname',__('First Name')) ?></th>
                <th><?php echo $this->Paginator->sort('lastname',__('Last Name')) ?></th>
                <th><?php echo $this->Paginator->sort('email',__('Email Address')) ?></th>
                <th><?php echo $this->Paginator->sort('Roles.name',__('Role Associated')) ?></th>
                <th><?php echo $this->Paginator->sort('status',__('status')) ?></th>
                <th class="actions"><?php echo __('action') ?></th>
            </tr>
Run Code Online (Sandbox Code Playgroud)

让我知道你有任何解决方案.

sorting paginator cakephp-3.0

7
推荐指数
2
解决办法
3942
查看次数

我可以根据屏幕大小更改默认的 mat-paginator 大小吗?

我有一个带有 mat-table 和 mat-paginator 的 angular 项目,类似于以下内容:

<div class="mat-elevation-z8">
  <table mat-table [dataSource]="dataSource" matSort>
    <ng-container matColumnDef="id">
      <th mat-header-cell *matHeaderCellDef mat-sort-header> ID </th>
      <td mat-cell *matCellDef="let row"> {{row.id}} </td>
    </ng-container>
    <ng-container matColumnDef="progress">
      <th mat-header-cell *matHeaderCellDef mat-sort-header> Progress </th>
      <td mat-cell *matCellDef="let row"> {{row.progress}}% </td>
    </ng-container>
    <ng-container matColumnDef="name">
      <th mat-header-cell *matHeaderCellDef mat-sort-header> Name </th>
      <td mat-cell *matCellDef="let row"> {{row.name}} </td>
    </ng-container>
    <ng-container matColumnDef="color">
      <th mat-header-cell *matHeaderCellDef mat-sort-header> Color </th>
      <td mat-cell *matCellDef="let row" [style.color]="row.color"> {{row.color}} </td>
    </ng-container>

    <tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
    <tr mat-row *matRowDef="let …
Run Code Online (Sandbox Code Playgroud)

paginator angular angular7

7
推荐指数
1
解决办法
9286
查看次数

mat-paginator 最后一个或第一个按钮上是否有 EventListener?

当我特别点击mat-paginator 最后一个按钮时,我需要听。有没有事件侦听器或方法可以做到这一点?

我尝试过:(page)="pageEvent = $event;emitPagination($event)"但它没有返回有关我点击位置的信息。

和同样的(click) = event($event)

HTML:

<mat-paginator #paginator 
    [length]="totalElements" 
    [pageSize]="5" 
    [showFirstLastButtons]="true" 
    (page)="pageEvent = $event;emitPagination($event)">
</mat-paginator>
Run Code Online (Sandbox Code Playgroud)

我希望在单击最后一个按钮时调用特定方法。

paginator angular-material angular angular5

6
推荐指数
1
解决办法
6550
查看次数