-
Notifications
You must be signed in to change notification settings - Fork 41
/
Copy pathAnalyticsDatatables.vue
38 lines (33 loc) · 1.2 KB
/
AnalyticsDatatables.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<template>
<div>
<h1>Survey Analytics - Table View (old browsers support)</h1>
<span>Uses DataTables (compatible with IE10+)</span>
<div id="tableContainer"></div>
</div>
</template>
<script>
import { Model } from "survey-vue";
import { DataTables } from "survey-analytics/survey.analytics.datatables";
import { json, data } from "../data/analytics_data";
import $ from "jquery";
import "datatables.net/js/jquery.dataTables.js";
import "datatables.net-dt/js/dataTables.dataTables.js";
import "datatables.net-buttons/js/dataTables.buttons.js";
import "datatables.net-buttons/js/buttons.print.js";
import "datatables.net-buttons/js/buttons.html5.js";
import "datatables.net-colreorder/js/dataTables.colReorder.js";
import "datatables.net-rowgroup/js/dataTables.rowGroup.js";
import "survey-analytics/survey.analytics.datatables.min.css";
import "datatables.net-colreorder-dt/css/colReorder.dataTables.css";
export default {
data() {
const survey = new Model(json);
return { survey };
},
mounted() {
DataTables.initJQuery($);
const surveyAnalyticsDataTables = new DataTables(this.survey, data);
surveyAnalyticsDataTables.render(document.getElementById("tableContainer"));
},
};
</script>