2015-06-03 30 views
0

我想爲我的結果運行雙重分頁,因爲它有數百萬個結果。當我使用$.fn.yiiListView.update更新結果時,我需要記錄它返回的記錄數。

回答

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部件以表格形式顯示的數據,並在每個「值」 => '...' 字符串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 

所以我想$行$ index是您需要的變量。 Source.

相關問題