我想为我的结果运行双重分页,因为它有数百万个结果。当我使用 更新结果时$.fn.yiiListView.update
,我需要它返回的记录计数。
问问题
109 次
1 回答
0
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是你需要的变量。资源。
于 2015-06-03T13:58:56.803 回答