question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add ability to get current filtered items in CDataTable

See original GitHub issue

After 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:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:5

github_iconTop GitHub Comments

5reactions
woothucommented, Feb 12, 2020

Feature introduced in 3.0.0-beta.11, commit: ea92ae74bacdf2ca2d09f3cdf09bb8933ab79d48

1reaction
CVeniamincommented, Feb 12, 2020

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 a CDataTable instead of an event but requires more code refactoring.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found