Skip to content

Commit d4c53ec

Browse files
committed
remove master details since it has conflict with responsive
1 parent c1a5ff2 commit d4c53ec

File tree

7 files changed

+14
-96
lines changed

7 files changed

+14
-96
lines changed

dist/index.js

Lines changed: 3 additions & 45 deletions
Large diffs are not rendered by default.

dist/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: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,13 @@
33
<head>
44
<meta charset="utf-8">
55
<title>vue-datatables-net demo</title>
6-
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
76
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
87
<link rel="stylesheet" href='https://cdn.datatables.net/1.10.19/css/dataTables.bootstrap4.min.css'>
98
<link rel="stylesheet" href="https://cdn.materialdesignicons.com/2.8.94/css/materialdesignicons.min.css">
9+
10+
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
11+
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
12+
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script>
1013
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.js"></script>
1114
</head>
1215
<body>

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=ee0fa1ac94620aef931e",
3-
"/index.js.map": "/index.js.map?id=4a2f13a304f773353510"
2+
"/index.js": "/index.js?id=2a497f1b6a0d73d31532",
3+
"/index.js.map": "/index.js.map?id=4433fd187969a1eec323"
44
}

src/VdtnetTable.vue

Lines changed: 2 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export default {
3535
// but you can override with: themeforest, foundation, etc..
3636
className: {
3737
type: String,
38-
default: 'table table-striped table-bordered dt-responsive nowrap w-100'
38+
default: 'table table-striped table-bordered nowrap w-100'
3939
},
4040
// the options object: https://datatables.net/manual/options
4141
opts: {
@@ -66,9 +66,6 @@ export default {
6666
*/
6767
selectable: {
6868
type: Boolean
69-
},
70-
details: {
71-
type: Object
7269
}
7370
},
7471
data() {
@@ -84,6 +81,7 @@ export default {
8481
language: {
8582
infoFiltered: ''
8683
},
84+
responsive: true,
8785
buttons: [] // remove any button defaults
8886
},
8987
dataTable: null
@@ -168,16 +166,6 @@ export default {
168166
}
169167
)
170168
}
171-
172-
if (vm.details) {
173-
const col = {
174-
orderable: false,
175-
className: 'details-control',
176-
data: null,
177-
defaultContent: vm.details.icons || '<span class="details-control-plus" title="Show Details">+</span><span class="details-control-minus" title="Hide Details">-</span>'
178-
}
179-
vm.options.columns.splice(1, 0, col)
180-
}
181169
},
182170
mounted() {
183171
const vm = this
@@ -246,37 +234,6 @@ export default {
246234
}
247235
}
248236
})
249-
250-
if (vm.details) {
251-
// must be string template
252-
const renderFunc = vm.compileTemplate(vm.details.template)
253-
254-
// handle master/details
255-
// Add event listener for opening and closing details
256-
$el.on('click', 'td.details-control', (e) => {
257-
e.preventDefault()
258-
e.stopPropagation()
259-
const target = jq(e.target)
260-
let that = target
261-
let tr = that.closest('tr')
262-
if (tr.attr('role') !== 'row') {
263-
tr = tr.prev()
264-
}
265-
const row = vm.dataTable.row( tr )
266-
267-
if ( row.child.isShown() ) {
268-
// This row is already open - close it
269-
row.child.hide()
270-
tr.removeClass('shown')
271-
}
272-
else {
273-
// Open this row
274-
const data = row.data()
275-
row.child( renderFunc(data, 'child', row, tr) ).show()
276-
tr.addClass('shown')
277-
}
278-
})
279-
}
280237
},
281238
methods: {
282239
compileTemplate(template) {

0 commit comments

Comments
 (0)