Yii - Get all data of filtered CGridView

2019-09-08 00:10发布

I got a question about the CGridView in Yii. The case is that I want to export the current filtered data of all pages within a CGridView to an excel sheet. Now the problem is that I am getting the id's of each row within the gridview with jQuery. This means that only the rows that are currently visible on the page of a pagination are sent to the excel generator and not the ones that are at another pages.

My question is, is there a way within Yii to get all the data from all paginated pages from a CGridView in some kind of object?

Thanks in advance.

标签: php yii
1条回答
The star\"
2楼-- · 2019-09-08 00:41

You can use the the $.fn.yiiGridView.getSelection(containerID) to retrieve the key values of the selected rows in jQuery. And then you can post your results and retrieve the exported file for downloading.

查看更多
登录 后发表回答