Skip to content

Commit 3e74032

Browse files
author
syshex
committed
#19 - release 1.1.13
1 parent 95ab0cc commit 3e74032

File tree

8 files changed

+42
-25
lines changed

8 files changed

+42
-25
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
### 1.1.13 (August 24, 2018)
4+
5+
* #19 - Disable filter for specific columns
6+
37
### 1.1.12
48

59
* Enhancement - exposed methods.

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ Or add the js script to your html (download from [releases](https://github.com/j
7979
title:"name",
8080
visible: true,
8181
editable: true,
82+
filterable: false
8283
},
8384
{
8485
title:"age",
@@ -267,6 +268,7 @@ The `columns` array takes object of type:
267268
cellstyle: String // Optional: styles to be applied to the Cells of this column
268269
renderfunction: Function // Optional: Function that receives as input the column name and entry, and returns an HTML String for drawing cell
269270
sortable: Boolean // Optional, by default it is true! Used to set particular columns as not sortable, in case the table is sortable itself. - From 1.1.12
271+
filterable: Boolean // Optional, by default it is true! Used to exclude columns from the filtering process. - From 1.1.13
270272
}
271273
```
272274

@@ -533,6 +535,10 @@ If you have a feature request, please add it as an issue or make a pull request.
533535

534536
## Changelog
535537

538+
### 1.1.13
539+
540+
* #19 - Disable filter for specific columns
541+
536542
### 1.1.12
537543

538544
* Enhancement - exposed methods.

dist/vue-bootstrap-table.js

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

dist/vue-bootstrap-table.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.

dist/vue-bootstrap-table.min.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.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue2-bootstrap-table2",
3-
"version": "1.1.12",
3+
"version": "1.1.13",
44
"description": "A sortable and searchable vue table, as a Vue component, using bootstrap styling.",
55
"keywords": [
66
"table",

src/VueBootstrapTable.vue

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -530,20 +530,20 @@
530530
});
531531
} else {
532532
var result = this.rawValues.filter(item => {
533-
var good = false;
534533
for (var col in self.displayColsVisible) {
535-
if (self.filterCaseSensitive) {
536-
if (lodashincludes(item[self.displayColsVisible[col].name] + "", self.filterKey + "")) {
537-
good = true;
538-
}
539-
} else {
540-
if (lodashincludes((item[self.displayColsVisible[col].name] + "").toLowerCase(), (self.filterKey + "").toLowerCase())) {
541-
good = true;
534+
if (self.displayColsVisible[col].filterable) {
535+
if (self.filterCaseSensitive) {
536+
if (lodashincludes(item[self.displayColsVisible[col].name] + "", self.filterKey + "")) {
537+
return true;
538+
}
539+
} else {
540+
if (lodashincludes((item[self.displayColsVisible[col].name] + "").toLowerCase(), (self.filterKey + "").toLowerCase())) {
541+
return true;
542+
}
542543
}
543544
}
544-
545545
}
546-
return good;
546+
return false;
547547
});
548548
549549
var tColsDir = [];
@@ -698,6 +698,10 @@
698698
obj.sortable = column.sortable;
699699
else
700700
obj.sortable = true;
701+
if ( typeof column.filterable !== "undefined")
702+
obj.filterable = column.filterable;
703+
else
704+
obj.filterable = true;
701705
702706
return obj;
703707
},

src/app.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ new Vue({
2525
handleRowFunction: handleRow,
2626
columnToSortBy:"name",
2727
ajax: {
28-
enabled: true,
28+
enabled: false,
2929
url: "http://172.16.213.1:9430/data/test",
3030
method: "POST",
3131
delegate: true
@@ -37,7 +37,8 @@ new Vue({
3737
},
3838
{
3939
title: 'Name',
40-
name: 'name'
40+
name: 'name' ,
41+
filterable: false
4142
},
4243
{
4344
title: 'Description',

0 commit comments

Comments
 (0)