vue-jd-table
An advanced and flexible Vue.js 2.x component for displaying data tables. Feature rich and capable of handing big data, JD-Table was designed to integrate into applications with various needs.
Features
- Supports internal/external (API) data
- Traditional pagination
- Virtual scroll pagination
- Responsive/Fixed table sizing
- Responsive/Fixed column sizing
- Full-text search
- Column filtering
- Column selection
- Column views
- Column sorting
- Column resizing
- Left/Right click context menusgit
- Excel exportation
- Full screen/minimize
- Row 'Quick View'
- ... and more!
Install
NPM
Font Awesome (Free) is required for JD-Table. Failing to install this will result in missing icons.
Manual
-
Clone this repository or download and save these files to your project:
- ./dist/jd-table.min.js
- ./dist/jd-table.min.css
-
Instructions for manually installing Font Awesome (Free) can be found here: https://fontawesome.com/start
Usage
Initialize
Initializing includes 4 parts: Template, Vue Component, Options/Props and Theme. Below are a number of different ways to initialize JD-Tables depending on your needs.
SFC
The following is an example of how to use JD-Tables in a Vue SFC (single file component).
Global
The following registers JD-Table as a global component. Once registered, you can use the instructions above (SFC) to use and apply the component without having to import it each time.
Script
The following shows an example of how to use JD-Table your HTML files directly. You will require a polyfill for JD-Table.
Browser Support
JD-Table runs in all modern browsers. IE11 is supported so long as a polyfill is provided.
Polyfill
JD-Table is written with ES5/6 functionality. Take note that the build module for JDTable does not include a polyfill. If you need support for legacy browsers like IE 11 you will need to inject a polyfill service.
Reminder: Typically build processes like Webpack & Vue-CLI do NOT add polyfill's to your imported dependencies (it will polyfill your app but not the JDTable dependency).
Polyfill Solution #1
For build processes like Webpack/Vue-CLI, rather then importing the component normally, import the .VUE file directly. If your project already includes polyfill's it will be processed normally.
import JDTable from 'vue-jd-table/src/jd-table.vue';
Polyfill Solution #2
For Vue-CLI specifically, create/add the following to vue.config.js. This will tell Vue-CLI to polyfill the normally imported JD-Table module.
vue.config.js
module.exports =
{
transpileDependencies : ['vue-jd-table']
};
Polyfill Solution #3
Using babel and babel-polyfill, directly add polyfill's to your dependency's.
babel.config.js
module.exports =
{
presets:
[
['env',
{
polyfills :
[
'es6.promise',
'es6.object.assign',
'es6.function.name',
'es6.array.find',
'es6.array.find-index',
'es7.array.includes',
'es6.string.includes'
]
}]
]
}