Skip to content

Sorted/Filtered table with data from Pinia store does not expose correct item id for use with expand row #360

Answered by gantonjo-tnm
gantonjo-tnm asked this question in Q&A
Discussion options

You must be logged in to vote

Never mind, by reading the code in the repository, I found that the expand-row function actually can be created to handle both the row index and row item, not only the row index as indicated in the documentation at https://hc200ok.github.io/vue3-easy-data-table-doc/features/expand-slot.html.

So, the example code:

const loadIntroduction = async (index: number): Promise<void> => {
  const expandedItem = items.value[index];
  if (!expandedItem.introduction) {
    expandedItem.expandLoading = true;
    expandedItem.introduction = await mockItemIntroduction(expandedItem.player);
    expandedItem.expandLoading = false;
  }
};

should have shown the following:

const loadIntroduction = async (ind…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by gantonjo-tnm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant