Add ability to get current filtered items in CDataTable
See original GitHub issueAfter looking at the docs CDataTable does not have an event that indicates what are the current filtered items after one applies a filter to a specific column or searched in a table.
Hence, after looking at the code I saw that this can be easily achieved by emitting an event after https://github.com/coreui/coreui-vue/blob/2ced24b5588e00d7e8c9ecdd42436f21868b4de1/src/components/table/CDataTable.vue#L455 and https://github.com/coreui/coreui-vue/blob/2ced24b5588e00d7e8c9ecdd42436f21868b4de1/src/components/table/CDataTable.vue#L463 for instance
this.$emit('update:table-items', this.currentItems)
The name of the new event is mere indicative.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:5
Top Results From Across the Web
DataTable - CoreUI
Filter items by one or all columns; Sort items by column; Integrated with CPagination component by default; Customize style of specific rows, ...
Read more >How I can filter a Datatable? - Stack Overflow
You can use DataView. DataView dv = new DataView(yourDatatable); dv.RowFilter = "query"; // query example = "id = 10".
Read more >filter() - DataTables
The filter() method provides a way of filtering out content in an API instance's result set which does not pass the criteria set...
Read more >Filter DataTable based on DataField
I would like to pull the ID Field and filter the DataTable (bp_changelog) below with just the relevant IDs based on the bp_live...
Read more >Dynamic Subset Add-In (Filterable Data Table, updated)
It would be very helpful if there was also a way (1) to instead of a subset to have the ability to summarize...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Feature introduced in 3.0.0-beta.11, commit: ea92ae74bacdf2ca2d09f3cdf09bb8933ab79d48
You are right! Was about to edit the issue since I saw that
currentItems
are the items visible items as you mentioned…One of the use cases would be to allow “download” the filtered items to a xlsx/csv file. I think this can also be achieved through using
v-model
on aCDataTable
instead of an event but requires more code refactoring.