YiiCGridView custom bottons method
Sample code
?
12345678910111213 |
Array ('class' => 'cbuttoncolumn', 'template' => '{email} {view} {update} {delete }', 'buttons' => array ('email '=> array ('label' => 'email', 'imageurl' => Yii: app () -> request-> baseUrl. '/images/icon_sina.gif', 'URL' => 'yii: app ()-> createUrl ("users/email ", array ("id" => $ data-> id ))',),),), |
Here is an example made by myself.
?
1234567891011121314151617181920212223242526272829303132333435 |
Widget ('zii. widgets. grid. CGridView ', array ('dataprovider' => $ model-> search (), 'column' => array ('selectablerdones' => 2, 'footer' =>'Batch delete', 'Class' => 'ccheckboxcolumn', 'headerhtmloptions' => array ('width' => '33px '), 'checkboxhtmloptions '=> array ('name' => 'selectdelete []'),), 'Company' => array ('name' => 'Company ', 'value' => '$ data-> company', 'footer '=>'Batch recommendation',), // Display the 'title' attribute 'model' => array ('name' => 'model ', 'value' => '$ data-> model', 'footer' =>'Cancel recommendation',), 'Top' => array ('name' => 'top', 'value' =>' $ data-> tops '), 'Category ', 'brand', 'Money', 'number', 'status' => array ('name' => 'status ', 'value' => '$ data-> getstatus'), array (// display a column with "view ", "update" and "delete" buttons 'class' => 'cbuttoncolumn',);?> |