primevue icon indicating copy to clipboard operation
primevue copied to clipboard

DataTable lazy loading paginator bug

Open tugcekucukoglu opened this issue 3 years ago • 1 comments

tugcekucukoglu avatar Mar 03 '22 07:03 tugcekucukoglu

@tugcekucukoglu could it be this happens at the same time to DataView?

I'm having troubles with both. I tried with :first but just doesn't react to it

jmverges avatar Mar 28 '22 16:03 jmverges

Is there any plan when this bug will be fixed? Or is there any workaround?

ig-onoffice-de avatar Oct 11 '22 10:10 ig-onoffice-de

Hello team, this is happening also in v 2.9.2 and is blocking my team to upgrade from 2.6.0 , do you have plan to look into this? Thanks!

blv-federicoviviani avatar Nov 16 '22 09:11 blv-federicoviviani

I think I might look into it this week-end and make a PR, but I might just end up replacing :first="lazy ? 0 : d_first" with :first="d_first" (I'm still unclear on why it's always 0 when lazy).

In the meantime, here's my quick hack to get it to work:

{
  mounted() {
    this.tmpHackFixPaginator();
  },
  methods: {
    tmpHackFixPaginator() {
      asSequence(this.$refs.dataTable.$children)
        .filter(vm => vm._name === "<DTPaginator>")
        .forEach(paginator => {
          paginator.d_first = this.first;
        });
    }
  }
}

Voltra avatar Dec 02 '22 14:12 Voltra

The DataTable needs to know which row will be the first, just as it needs to know the number of rows.

https://stackblitz.com/edit/lxpxlz-93qeul?file=src%2FApp.vue%3AL106

tugcekucukoglu avatar Aug 21 '23 10:08 tugcekucukoglu