dongxia4880 2015-06-03 12:56
浏览 82

我可以在Yii中获得$ .fn.yiiListView.update的数量吗?

I want run a dual pagination for my result as it has millions of results. When I am updating the result using $.fn.yiiListView.update, I need count of record returned by it.

  • 写回答

1条回答 默认 最新

  • dsedug8644 2015-06-03 13:58
    关注

    There are special $variables in CGridView and CListView.

    The CListView widget calls your partial rendering _view on each item, setting these variables before calling each one:

    $data - the current object or hash being rendered
    $index - the zero-based index of the item being rendered (0, 1, 2, ...)
    $this - the owner of the widget, usually the calling controller
    $widget - the CListView widget itself
    

    The CGridView widget displays data in tabular form, and when each 'value' => '...' string is eval'd, these variables are available:

    $data - the current object or hash being rendered
    $row - the zero-based index of the item being rendered (0, 1, 2, ...)
    $this - the CGridColumn object representing the column being rendered
    $this->grid - the CGridView object that owns the column
    $this->grid->owner - the owner of the grid, usually the calling controller
    

    So I guess $row and $index are the variables you need. Source.

    评论

报告相同问题?

悬赏问题

  • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
  • ¥30 深度学习,前后端连接
  • ¥15 孟德尔随机化结果不一致
  • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀
  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100
  • ¥15 关于#hadoop#的问题
  • ¥15 (标签-Python|关键词-socket)
  • ¥15 keil里为什么main.c定义的函数在it.c调用不了