Skip to content

Commit 20b4e06

Browse files
author
syshex
committed
#5 - fixed , along with changing props error
1 parent d57f4ec commit 20b4e06

File tree

2 files changed

+33
-7
lines changed

2 files changed

+33
-7
lines changed

src/VueBootstrapTable.vue

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,7 @@
336336
columnMenuOpen: false,
337337
displayCols: [],
338338
filteredValues: [],
339+
rawValues: [],
339340
page: 1,
340341
echo: 0,
341342
loading: false,
@@ -354,26 +355,27 @@
354355
if (!this.ajax.delegate) {
355356
this.loading= true;
356357
this.fetchData(function (data) {
357-
self.values = data.data;
358+
self.rawValues = data.data;
358359
self.processFilter();
359360
});
360361
}else
361362
this.processFilter();
362-
}else
363+
}else {
364+
self.rawValues = self.values;
363365
this.processFilter();
366+
}
364367
})
365368
},
366369
created: function () {
367370
var self = this ;
368-
console.log("created");
369371
this.$on('cellDataModifiedEvent', self.fireCellDataModifiedEvent);
370372
},
371373
beforeDestroy: function(){
372374
var self = this ;
373375
this.$off('cellDataModifiedEvent', self.fireCellDataModifiedEvent);
374376
},
375377
watch: {
376-
values: function () {
378+
rawValues: function () {
377379
this.processFilter();
378380
},
379381
columns: function () {
@@ -469,7 +471,7 @@
469471
self.loading = false;
470472
});
471473
} else {
472-
var result = this.values.filter(item => {
474+
var result = this.rawValues.filter(item => {
473475
var good = false;
474476
for (var col in self.displayColsVisible) {
475477
if (self.filterCaseSensitive) {
@@ -510,6 +512,7 @@
510512
}
511513
},
512514
fetchData: function ( dataCallBackFunction ) {
515+
console.log("fetching data");
513516
var self = this;
514517
var ajaxParameters = {
515518
params: {}

src/app.js

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ new Vue({
2727
enabled: true,
2828
url: "http://172.16.213.1:9430/data/test",
2929
method: "POST",
30-
delegate: true,
30+
delegate: false,
3131
axiosConfig:{
3232
headers: {
3333
'Authorization': 'Bearer TESTTESTTESTTESTTEST'
@@ -64,7 +64,30 @@ new Vue({
6464
name: 'postal_code'
6565
}
6666
],
67-
values: []
67+
values: [
68+
{
69+
"id": "111",
70+
"name": "Casper Cliff",
71+
"description": "Id est rem aliquam animi libero minima. Praesentium ad cum autem quo voluptatum autem ea. Non rerum aliquam atque minima et. Omnis maiores debitis odio consequatur officiis.",
72+
"created_by": 3,
73+
"street_address": "90947 Schaefer Ramp",
74+
"city": "Lake Jammiemouth",
75+
"state_province": "Alaska",
76+
"postal_code": "35070",
77+
"status": "open"
78+
},
79+
{
80+
"id": "0D7D9DB64C7946E0B3FBDDFC",
81+
"name": "Alfredo Shore",
82+
"description": "Beatae deserunt aut voluptas modi repudiandae sit animi. Minima sit quam eligendi non aliquid et excepturi. Fugit reiciendis illo illum eum quidem minus.",
83+
"created_by": 4,
84+
"street_address": "1943 Ericka Shoal Suite 196",
85+
"city": "Johnathanshire",
86+
"state_province": "Georgia",
87+
"postal_code": "87106",
88+
"status": "open"
89+
}
90+
]
6891
},
6992
created: function () {
7093
var self = this;

0 commit comments

Comments
 (0)