DataTable Column Toggle

UI Components for Vue
Post Reply
ferdia
Posts: 7
Joined: 01 Jun 2021, 12:25

22 Nov 2021, 19:26

Hi there,

We're using primevue datatable to display large amounts of data, and offer the user to toggle columns as described in documentation. We have noted that it requires a considerable amount of time to toggle columns (sometimes up to 5 seconds). When we took a closer look at the code, we noticed that this is a very expensive / inefficient way of doing it:

Code: Select all

    // ....
    methods: {
        onToggle(value) {
            this.selectedColumns = this.columns.filter(col => value.includes(col));
        }
    }
We assume it would be far more efficient to simply toggle a CSS class that conditionally hides a whole column (dispay:none). The easiest way would be to add style to the table column element (col), see example . But of some reason, you don't seem to employ col elements for the datatable (why not?). Given the lack of column elements, it would still be much better to use CSS - as for example this post describes. Is this something you plan to fix?

Keep up the good work :)

tugce.kucukoglu
Posts: 560
Joined: 23 Oct 2020, 09:28

24 Nov 2021, 15:28

Hi,

For now, it's not on our roadmap. Could you create an issue for this so community could discuss it.

Regards,

ferdia
Posts: 7
Joined: 01 Jun 2021, 12:25

24 Nov 2021, 21:11


Post Reply

Return to “PrimeVue”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 6 guests