It seems like DataView component does wrong thing trying to take props.value.slice(first) to render entries. By doing go, this component effective forces user to represent data as continuous array. I will explain it in more details using my use case.
I store data in Map<page_idx, data_entry[]> and when page event is thrown by DataView, I put myDataMap.get(pageIdx) into value property (btw I also tried to set first prop to 0 and it didn't help). And it shows empty grid/list because actually it tries to take value.slice(data.d_first) for some reason. I know that by inspecting DataView component via vue dev tools and it shows data section where d_first and d_rows local variables reside. When I set d_first to zero - data starts to appear.
As temporal solution I simply ignore what I got in via grid/list slot items field and use my computed page directly. But I consider this as a bug because it clearly forces me to put all the data in array before setting value prop. This is also invalid because one could simply doesn't have all the data pages in that array (imagine initially I have only first data page and then I click and load for example 5th data page).
Describe the bug
It seems like
DataView
component does wrong thing trying to takeprops.value.slice(first)
to render entries. By doing go, this component effective forces user to represent data as continuous array. I will explain it in more details using my use case.I store data in
Map<page_idx, data_entry[]>
and whenpage
event is thrown byDataView
, I putmyDataMap.get(pageIdx)
intovalue
property (btw I also tried to setfirst
prop to0
and it didn't help). And it shows empty grid/list because actually it tries to takevalue.slice(data.d_first)
for some reason. I know that by inspectingDataView
component via vue dev tools and it showsdata
section whered_first
andd_rows
local variables reside. When I setd_first
to zero - data starts to appear.As temporal solution I simply ignore what I got in via
grid/list
slotitems
field and use my computed page directly. But I consider this as a bug because it clearly forces me to put all the data in array before settingvalue
prop. This is also invalid because one could simply doesn't have all the data pages in that array (imagine initially I have only first data page and then I click and load for example 5th data page).Reproducer
-
PrimeVue version
4.0.4
Vue version
4.x
Language
TypeScript
Build / Runtime
Vue CLI App
Browser(s)
Chromium
Steps to reproduce the behavior
No response
Expected behavior
No response