Skip to content

Commit 96b6b83

Browse files
committed
configurable data column
1 parent 3e2f503 commit 96b6b83

File tree

9 files changed

+59
-44
lines changed

9 files changed

+59
-44
lines changed

README.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,21 @@ This library default configuration and provide example for `bootstrap4` styling.
4949

5050
<script>
5151
import VdtnetTable from 'vue-datatables-net'
52+
5253
import 'datatables.net-bs4'
5354
54-
/*
55-
// import any datatables.net extension as you would when using it raw
55+
// below you should only import what you need
56+
// Example: import buttons and plugins
57+
import 'datatables.net-buttons/js/dataTables.buttons.js'
58+
import 'datatables.net-buttons/js/buttons.html5.js'
59+
import 'datatables.net-buttons/js/buttons.print.js'
60+
61+
// import the rest for your specific theme
62+
import 'datatables.net-buttons-bs4'
5663
import 'datatables.net-select-bs4'
5764
58-
// import any styles to support the packages you import above
59-
import 'datatables.net-bs4/css/dataTables.bootstrap4.min.css'
6065
import 'datatables.net-select-bs4/css/select.bootstrap4.min.css'
61-
*/
66+
import 'datatables.net-buttons-bs4/css/buttons.bootstrap4.min.css'
6267
</script>
6368
```
6469

@@ -181,6 +186,7 @@ fields: {
181186
- `searchable` true to enable search of field
182187
- `sortable` false to disable sorting
183188
- `name` to override the name
189+
- `data` differentiate server-side sorting field - optional default to `name`
184190
- `visible` false to hide
185191
- `width` to provide custom width
186192
- `className` set column class names

example/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,7 @@ __webpack_require__.r(__webpack_exports__);
579579
var col = {
580580
title: field.label || field.name,
581581
width: field.width,
582-
data: field.name,
582+
data: field.data || field.name,
583583
name: field.name,
584584
className: field.className
585585
};

example/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
<title>vue-datatables-net demo</title>
66
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
77
<link rel="stylesheet" href='https://cdn.datatables.net/1.10.19/css/dataTables.bootstrap4.min.css'>
8-
<link rel="stylesheet" href="https://cdn.materialdesignicons.com/3.5.95/css/materialdesignicons.min.css">
8+
<link rel="stylesheet" href="https://cdn.materialdesignicons.com/3.6.95/css/materialdesignicons.min.css">
99

10-
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
10+
<script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
1111
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
1212
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
1313
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.js"></script>

lib/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/mix-manifest.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"/index.js": "/index.js?id=3560ad448a37fa3d71c5",
3-
"/index.js.map": "/index.js.map?id=aec5afec3dd3eab095f2"
2+
"/index.js": "/index.js?id=37336752df717b9324d7",
3+
"/index.js.map": "/index.js.map?id=c83eba6d7c52c25f97e5"
44
}

package-lock.json

Lines changed: 36 additions & 27 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "vue-datatables-net",
33
"description": "Vue jQuery DataTables.net wrapper component",
4-
"version": "1.1.3",
4+
"version": "1.1.4",
55
"author": "[email protected]",
66
"license": "MIT",
77
"main": "lib/index.js",
@@ -34,7 +34,7 @@
3434
"vue": ">=2.0.0"
3535
},
3636
"devDependencies": {
37-
"@babel/core": "^7.4.4",
37+
"@babel/core": "^7.4.5",
3838
"@babel/plugin-syntax-dynamic-import": "^7.2.0",
3939
"babel-eslint": "^10.0.1",
4040
"bootstrap": "^4.3.1",
@@ -46,10 +46,10 @@
4646
"datatables.net-buttons-bs4": "^1.5.6",
4747
"datatables.net-select-bs4": "^1.2.7",
4848
"eslint": "^5.16.0",
49-
"eslint-config-prettier": "^4.2.0",
49+
"eslint-config-prettier": "^4.3.0",
5050
"eslint-friendly-formatter": "^4.0.1",
5151
"eslint-loader": "^2.1.2",
52-
"eslint-plugin-import": "^2.17.2",
52+
"eslint-plugin-import": "^2.17.3",
5353
"eslint-plugin-vue": "^5.2.2",
5454
"file-loader": "^3.0.1",
5555
"jquery": "^3.4.1",

0 commit comments

Comments
 (0)