Skip to content

Commit 196c52a

Browse files
author
syshex
committed
updating package and examples
1 parent 6b7926c commit 196c52a

File tree

4 files changed

+39
-10047
lines changed

4 files changed

+39
-10047
lines changed

examples/01-basic.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,18 @@ <h1>Vue Bootstrap Table Demo</h1>
2525
:show-filter="showFilter"
2626
:show-column-picker="showPicker"
2727
:paginated="paginated"
28+
:ajax="ajax"
2829
>
2930
</vue-bootstrap-table>
3031
</div>
3132
<h2>Events Received</h2>
3233
<div>
33-
{{ logging | json}}
34+
{{ logging }}
3435
</div>
3536
</div>
3637

3738
</div>
38-
<script src="vue.js"></script>
39+
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.3.3/vue.js"></script>
3940
<script src="../dist/vue-bootstrap-table.js"></script>
4041
<script src="01-basic.js"></script>
4142
</body>

examples/01-basic.js

Lines changed: 34 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
Vue.config.debug = true;
2-
Vue.config.devtools = true;
1+
//Vue.config.debug = true;
2+
//Vue.config.devtools = true;
33

44
new Vue({
55
el: '#app',
@@ -11,24 +11,33 @@ new Vue({
1111
showFilter: true,
1212
showPicker: true,
1313
paginated: true,
14+
ajax: {
15+
enabled: false,
16+
url: "http://localhost:9430/data/test",
17+
method: "POST",
18+
delegate: true,
19+
},
1420
columns: [
1521
{
1622
title:"id",
1723
visible: true,
1824
editable: false,
1925
},
2026
{
21-
title:"name",
27+
title:"Name",
28+
name: "name",
2229
visible: true,
2330
editable: true,
2431
},
2532
{
26-
title:"age",
33+
title:"Age",
34+
name: "age",
2735
visible: true,
2836
editable: true,
2937
},
3038
{
31-
title:"country",
39+
title:"Country",
40+
name: "country",
3241
visible: true,
3342
editable: true,
3443
}
@@ -54,7 +63,26 @@ new Vue({
5463
}
5564
]
5665
},
57-
ready: function () {
66+
created: function () {
67+
var self = this;
68+
this.$on('cellDataModifiedEvent',
69+
function( originalValue, newValue, columnTitle, entry) {
70+
self.logging.push("cellDataModifiedEvent - Original Value : " + originalValue +
71+
" | New Value : " + newValue +
72+
" | Column : " + columnTitle +
73+
" | Complete Entry : " + entry );
74+
}
75+
);
76+
this.$on('ajaxLoadedEvent',
77+
function( data ) {
78+
this.logging.push("ajaxLoadedEvent - data : " + data );
79+
}
80+
);
81+
this.$on('ajaxLoadingError',
82+
function( error ) {
83+
this.logging.push("ajaxLoadingError - error : " + error );
84+
}
85+
);
5886
},
5987
methods: {
6088
addItem: function() {
@@ -77,12 +105,4 @@ new Vue({
77105
this.paginated = !this.paginated;
78106
}
79107
},
80-
events: {
81-
cellDataModifiedEvent: function( originalValue, newValue, columnTitle, entry) {
82-
this.logging.push("Original Value : " + originalValue +
83-
" | New Value : " + newValue +
84-
" | Column : " + columnTitle +
85-
" | Complete Entry : " + entry );
86-
},
87-
},
88108
});

0 commit comments

Comments
 (0)