I am using zii grid view, i change action buttons and they are working fine, using this link Click Here
But i have to add button customization in every controller, Is there any other way by that i can manage it via one file? means i dont want to add same code on every page.
Yii::import('zii.widgets.grid.CGridView');
class MyGridView extends CGridView
{
//override the appropriate methods, may call the parent::theMethod()
}
and use ext.yourgridview.yourFilegridview instead of zii.widgets.grid.CGridView
Another way is to create a method in components/conroller.php with argument an array parameters (the parameters of CGridView) merge this array with your custom button and call by itself the CGridView
for gridview you have to extend CButtonColumn in components
Yii::import('zii.widgets.grid.CButtonColumn');
class BButtonColumn extends CButtonColumn{
public function initDefaultButtons(){
// make ur changes here
}
}
then use BButtonColumn in ur gridview instead of CButtonColumn