Yii - 获取过滤后的 CGridView 的所有数据 [英] Yii - Get all data of filtered CGridView
问题描述
我有一个关于 Yii 中 CGridView
的问题.案例是我想将 CGridView
中所有页面的当前过滤数据导出到 Excel 表.现在的问题是我正在使用 jQuery 获取 gridview 中每一行的 id.这意味着只有当前在分页页面上可见的行才会发送到 excel 生成器,而不是其他页面上的行.
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.
我的问题是,Yii 中有没有办法从某种对象中的 CGridView
中获取所有分页页面的所有数据?
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?
提前致谢.
推荐答案
您可以使用 $.fn.yiiGridView.getSelection(containerID)
在 jQuery 中检索所选行的键值.然后您可以发布您的结果并检索导出的文件以供下载.
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.
这篇关于Yii - 获取过滤后的 CGridView 的所有数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!