0.1.56 • Published 7 months ago

@qualle-web/vuetify-virtual-table v0.1.56

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

Alt text

vuetify-virtual-table

License: MIT

A virtual table built with Vue and Vuetify

Alt text

Installation

Install with yarn:

yarn

yarn serve

Import as component in component file

import VirtualTable from '@qualle-web/vuetify-virtual-table';

export default {
  name: 'component_name',
  components: {
    VirtualTable
  }
}

Examples

Basic

The basic example shows how to use the VirtualTable component:

<template>
  <v-container id="app">
    <v-row class="pa-0 ma-0">
      <v-card
        data-v-step="1"
        class="pa-0 ma-0 width-100 background-transparent"
        elevation="0"
      >
        <VirtualTable
          :tableHeaders="tableHeaders"
          :tableOptions="{
            tableHeight: 600,
            rowHeight: 48,
            singleSelect,
            showSelect,
            showExpand,
            itemsToExclude,
            columnSortOrder,
          }"
          :entities="entities"
          :selected="selected"
          :loading="loading"
          @selectAllToggle="selectAllToggle"
          @onSelectRow="selected = $event"
        />
      </v-card>
    </v-row>
  </v-container>
</template>

<script>
import VirtualTable from "./components/VirtualTable";
import moment from "moment";

export default {
  name: "App",
  components: { VirtualTable },
  data: () => ({
    tableHeaders: [
      {
        text: "Name",
        value: "name",
        width: "25%",
        adjustable: true,
        sortable: true,
      },
      {
        text: "Title",
        value: "title",
        width: "25%",
        adjustable: true,
        sortable: true,
      },
      {
        text: "Address",
        value: "address",
        width: "25%",
        adjustable: true,
        sortable: true,
      },
      {
        text: "date",
        value: "date",
        width: "25%",
        align: center,
        adjustable: true,
        sortable: true,
        sorter: (a, b) => {
          if (moment(a).isValid()) {
            return moment(new Date(a)).diff(moment(new Date(b)));
          }
        },
      },
    ],

    columnSortOrder: ["name", "title", "address", "date"],

    itemsToExclude: ["id", "owner"],

    selected: [],

    singleSelect: false,
    showSelect: true,
    showExpand: true,

    loading: false,

    entities: new Array(1000).map((item, index) => ({
      name: index,
      title: index,
      address: index,
      date: moment().add(index, "days"),
    })),
  }),
  methods: {
    selectAllToggle($event) {
      console.log($event);
    },
  },
};
</script>

The VirtualTable tag requires a entities property, which is an array of objects which contain the data:

<VirtualTable :entities="entities">
</VirtualTable>
0.1.55

10 months ago

0.1.56

7 months ago

0.1.54

1 year ago

0.1.53

2 years ago

0.1.52

2 years ago

0.1.51

2 years ago

0.1.50

2 years ago

0.1.48

2 years ago

0.1.47

2 years ago

0.1.46

2 years ago

0.1.45

2 years ago

0.1.44

2 years ago

0.1.43

2 years ago

0.1.42

2 years ago

0.1.41

2 years ago

0.1.40

2 years ago

0.1.39

2 years ago

0.1.38

2 years ago

0.1.37

2 years ago

0.1.36

2 years ago

0.1.35

2 years ago

0.1.34

2 years ago

0.1.33

2 years ago

0.1.32

2 years ago

0.1.31

2 years ago

0.1.30

2 years ago

0.1.29

2 years ago

0.1.28

2 years ago

0.1.27

2 years ago

0.1.26

2 years ago

0.1.25

2 years ago

0.1.24

2 years ago

0.1.23

2 years ago

0.1.22

2 years ago

0.1.21

2 years ago

0.1.20

2 years ago

0.1.19

2 years ago

0.1.18

2 years ago

0.1.17

2 years ago

0.1.16

2 years ago

0.1.15

2 years ago

0.1.14

2 years ago

0.1.13

2 years ago

0.1.12

2 years ago

0.1.11

2 years ago

0.1.10

2 years ago

0.1.9

2 years ago

0.1.8

2 years ago

0.1.7

2 years ago

0.1.6

2 years ago

0.1.5

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago