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.

UseVirualList in Tables

See original GitHub issue

Hi was wondering if it was possible useVirtualList within a table:

I show an example of what I’m trying to do without success

<table>
  <thead>
    <tr>
       <TableHeader />
    </tr>
  </thead>
  <tbody>
      <UseVirtualList>
          <TableRows />
      </UseVirtualList>
  </tbody>
</table>

Any tips or ideas on how to approach this will be great.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5

github_iconTop GitHub Comments

2reactions
mitchhymelcommented, Aug 13, 2022

I was trying to do something similar and got it working the way I wanted with useVirtualList. The thing that got it working for me was putting the table within the container and wrapper divs. Not sure if you were specifically asking how to do this with the renderless component, but hopefully this helps.

<script setup>
import { useVirtualList } from '@vueuse/core'
const { list, containerProps, wrapperProps } = useVirtualList(
  yourListOfData, 
  { itemHeight: 22, }
)
</script>

<template>
  <div v-bind="containerProps" style="height: 500px;">
        <div v-bind="wrapperProps">
          <table>
            <thead>
              <tr>
                 <-- Your headers here -->
                <th>Id</th>
                <th>Name</th>
              </tr>
            </thead>
            <tbody>
              <tr v-for="item in list"
                style="height: 22px;"
                :key="item.index">
                  <-- Your row here -->
                   <td>item.data.id</td>
                   <td>item.data.name</td>
              </tr>
            </tbody>
          </table>
        </div>
      </div>
</template>
0reactions
mitchhymelcommented, Nov 11, 2022

Unfortunately, I never figured out how to get it working with a static header.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Virtual List Simplified – FileMakerHacks
The basic idea behind virtual list is that you create a dedicated utility table in your solution, and pre-populate it with “more records...
Read more >
Virtual List and Custom Report Development in FileMaker
A virtual list in FileMaker can collect specific data and deliver it to users in one, comprehensive report. We're sharing how to set...
Read more >
Virtual List in 3 Easy Steps - MightyData
Knowing how to set up and use virtual lists will help with creating certain reports, especially if you draw the values from ExecuteSQL ......
Read more >
Display Large Amounts Of Data With A Virtual List
Virtual lists are lists that render only the visible elements inside their viewport, they allow us to efficiently render huge amounts of ...
Read more >
Virtual List tutorial? - Claris Community - FileMaker Pro
My understanding now is that a Virtual List essentially populates a table with Virtual records by utilizing global variables and ...
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