I wrote a Class MyGridView extends from the CGridView.
MyGridView will automaticlly generate two buttons in the header,
one is a pdf icon, another is a excel icon. but how can I bind event to this two icon?
so that I can use my code to generate PDF or EXCEL for this CGridView based on the dataprovider and columns.
the PDF export code and the EXCEL export code are all ready, I just don’t know how to bind server-side event for the Class
this depends a lot on your code to generate the PDF and EXCEL files, there are several ways to “bind” those buttons to generate the files.
for the first case, you can pass a parameter to the action that tells it to generate the corresponding file:
Then in your MyGridClass, just point your buttons to the corresponding url:
You can adjust this to have 2 separate actions if you want.