Skip to main content

Posts

Showing posts with the label YII CGridView add a custom action button

YII CGridView add a custom button like edit,delete,import etc

Add a custom button to YII CGridView like update,delete buttons You can use template property to change order of build-in buttons or add/remove new buttons like this: array ( ' class ' => ' CButtonColumn ' , ' template ' => ' {delete}{update} ' , ) In CGridView's buttons column build upon above example there will be no view button and delete and update buttons will be in other than default order (delete first). You can use the same property to introduce new buttons: array ( ' class ' => ' CButtonColumn ' , ' template ' => ' {up}{down}{delete} ' , ) For new buttons (and of course - for existing, build-in ones too!) you have to specify look and behaviour. buttons  property of CButtonColumn is used for it. This property is an array of buttons id (which names must correspond to the one provided in  template  property) and each button is another array holding its specific ...