Skip to content

Commit bf9b5d0

Browse files
author
syshex
committed
1.1.6 - Search case sensitivity configurable
1 parent d5aed3f commit bf9b5d0

File tree

5 files changed

+37
-4
lines changed

5 files changed

+37
-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: 14 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 1 : 1.1.5
5+
### VUE 1 : 1.1.6
66

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

@@ -126,6 +126,7 @@ Or add the js script to your html (download from [releases](https://github.com/j
126126
:sortable="true"
127127
:multi-column-sortable=true
128128
:paginated="true"
129+
:filter-case-sensitive=false
129130
>
130131
</vue-bootstrap-table>
131132
````
@@ -174,6 +175,14 @@ Or add the js script to your html (download from [releases](https://github.com/j
174175
required: false,
175176
default: false,
176177
},
178+
/**
179+
* Define if Filter search field is to work in a case Sensitive way. Default: true
180+
*/
181+
filterCaseSensitive: {
182+
type: Boolean,
183+
required: false,
184+
default: true,
185+
},
177186
/**
178187
* Enable/disable column picker to show/hide table columns, optional, default false
179188
*/
@@ -462,6 +471,10 @@ If you have a feature request, please add it as an issue or make a pull request.
462471

463472
## Changelog
464473

474+
### 1.1.6
475+
476+
* Search case sensitivity configurable
477+
465478
### 1.1.5
466479

467480
* Row Click Handler added

index.html

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-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
*/
@@ -448,9 +456,16 @@
448456
var result = this.values.filter(item => {
449457
var good = false;
450458
for (var col in self.displayColsVisible) {
451-
if ( lodashincludes(item[self.displayColsVisible[col].name]+"" , self.filterKey+"")){
452-
good = true;
459+
if (self.filterCaseSensitive) {
460+
if (lodashincludes(item[self.displayColsVisible[col].name] + "", self.filterKey + "")) {
461+
good = true;
462+
}
463+
} else {
464+
if (lodashincludes((item[self.displayColsVisible[col].name] + "").toLowerCase(), (self.filterKey + "").toLowerCase())) {
465+
good = true;
466+
}
453467
}
468+
454469
}
455470
return good;
456471
});

0 commit comments

Comments
 (0)