【发布时间】:2015-06-03 12:56:17
【问题描述】:
我想为我的结果运行双分页,因为它有数百万个结果。当我使用$.fn.yiiListView.update 更新结果时,我需要它返回的记录计数。
【问题讨论】:
我想为我的结果运行双分页,因为它有数百万个结果。当我使用$.fn.yiiListView.update 更新结果时,我需要它返回的记录计数。
【问题讨论】:
CGridView 和 CListView 中有特殊$variables。
CListView 小部件在每个项目上调用您的部分渲染_view,在调用每个变量之前设置这些变量:
$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
CGridView 小部件以表格形式显示数据,当每个 'value' => '...' 字符串被 eval'd 时,这些变量可用:
$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
所以我猜 $row 和 $index 是您需要的变量。 Source.
【讨论】: