Skip to content

Commit 247ddf7

Browse files
author
syshex
committed
1.1.6 - Search case sensitivity configurable
1 parent 669223d commit 247ddf7

File tree

5 files changed

+38
-4
lines changed

5 files changed

+38
-4
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.6 (June 29, 2017)
4+
5+
* Search case sensitivity configurable
6+
37
### 1.1.5 (June 21, 2017)
48

59
* Row Click Handler added

README.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
vue-bootstrap-table is a sortable and searchable table, with Bootstrap styling, for Vue.js.
44

5-
### VUE 2 : 1.1.5
5+
### VUE 2 : 1.1.6
66

77
### Vue 1 : [jbaysolutions/vue-bootstrap-table](https://github.com/jbaysolutions/vue-bootstrap-table)
88

@@ -126,6 +126,8 @@ Or add the js script to your html (download from [releases](https://github.com/j
126126
:sortable="true"
127127
:paginated="true"
128128
:multi-column-sortable=true
129+
:filter-case-sensitive=false
130+
129131
>
130132
</vue-bootstrap-table>
131133
````
@@ -174,6 +176,14 @@ Or add the js script to your html (download from [releases](https://github.com/j
174176
required: false,
175177
default: false,
176178
},
179+
/**
180+
* Define if Filter search field is to work in a case Sensitive way. Default: true
181+
*/
182+
filterCaseSensitive: {
183+
type: Boolean,
184+
required: false,
185+
default: true,
186+
},
177187
/**
178188
* Enable/disable column picker to show/hide table columns, optional, default false
179189
*/
@@ -471,6 +481,10 @@ If you have a feature request, please add it as an issue or make a pull request.
471481

472482
## Changelog
473483

484+
### 1.1.6
485+
486+
* Search case sensitivity configurable
487+
474488
### 1.1.5
475489

476490
* Row Click Handler added

index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ <h1>Vue Bootstrap Table</h1>
3838
:multi-column-sortable="multiColumnSortable"
3939
:ajax="ajax"
4040
:row-click-handler=handleRowFunction
41+
:filter-case-sensitive=false
4142
>
4243
</vue-bootstrap-table>
4344
</div>

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.5",
3+
"version": "1.1.6",
44
"description": "A sortable and searchable vue table, as a Vue component, using bootstrap styling.",
55
"keywords": [
66
"table",

src/VueBootstrapTable.vue

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,14 @@
268268
required: false,
269269
default: false,
270270
},
271+
/**
272+
* Define if Filter search field is to work in a case Sensitive way. Default: true
273+
*/
274+
filterCaseSensitive: {
275+
type: Boolean,
276+
required: false,
277+
default: true,
278+
},
271279
/**
272280
* Enable/disable column picker to show/hide table columns, optional, default false
273281
*/
@@ -461,9 +469,16 @@
461469
var result = this.values.filter(item => {
462470
var good = false;
463471
for (var col in self.displayColsVisible) {
464-
if ( lodashincludes(item[self.displayColsVisible[col].name]+"" , self.filterKey+"")){
465-
good = true;
472+
if (self.filterCaseSensitive) {
473+
if (lodashincludes(item[self.displayColsVisible[col].name] + "", self.filterKey + "")) {
474+
good = true;
475+
}
476+
} else {
477+
if (lodashincludes((item[self.displayColsVisible[col].name] + "").toLowerCase(), (self.filterKey + "").toLowerCase())) {
478+
good = true;
479+
}
466480
}
481+
467482
}
468483
return good;
469484
});

0 commit comments

Comments
 (0)