2014年7月21日 星期一

[YII教學]-TbGridView參數使用

TbGridView參數使用

在Controller底下的action寫一段給dataProvider,透過dataProvider回傳給web的widget.TbGridView.


'header'=>'No',  /* HTML title 顯示 */

'headerHtmlOptions'=>array('style'=>'text-align:center'),  /* HTML title style calss 用法 */

'value'=>'$this->grid->dataProvider->pagination->currentPage * $this->grid->dataProvider->pagination->pageSize + ($row+1)',  /* HTML value 建一個No順序 ex:1-10 */

'htmlOptions'=>array('style'=>'width: 60px;','style'=>'text-align:center'),  /* value style class 用法*/

沒有留言:

張貼留言