admin管理员组文章数量:1390410
Is it possible to get values from mui DataGrid?
I have a table and i want to have a custom export based on user filter and columns that are hidden or displayed but i need these filtered values. There is any way to get this from DataGrid?
Is it possible to get values from mui DataGrid?
I have a table and i want to have a custom export based on user filter and columns that are hidden or displayed but i need these filtered values. There is any way to get this from DataGrid?
Share Improve this question edited Jan 21, 2022 at 17:10 Alexsandro Xavier Da Silveira asked Jan 20, 2022 at 16:05 Alexsandro Xavier Da SilveiraAlexsandro Xavier Da Silveira 512 silver badges5 bronze badges3 Answers
Reset to default 4You may want to use the gridFilteredSortedRowIdsSelector
Most of the useful seletors for exporting are defined in the "Exported rows" section
The prop onSelectionModelChange gives you the IDs of the selected cells, and then you can filter them based on your requirements to export the selected ones.
<DataGridPro
onSelectionModelChange={(props)=>{
console.log(props);
}}
/>
DataGrid MUI has onStateChange
, which have all the values, filtered values, count, and current state of the grid:
onStateChange={(e) => {
console.log(e.pagination.rowCount)
console.log(e)
}}
本文标签: javascriptHow to get filtered values from MUI datagridStack Overflow
版权声明:本文标题:javascript - How to get filtered values from MUI datagrid - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744686851a2619754.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论