Commit 7c57b6bc authored by James Kirby's avatar James Kirby

Adding the option to enable full value filtering.

parent 6367ced0
......@@ -320,6 +320,7 @@
selectAllNumber: true,
enableFiltering: false,
enableCaseInsensitiveFiltering: false,
enableFullValueFiltering: false,
enableClickableOptGroups: false,
filterPlaceholder: 'Search',
// possible options: 'text', 'value', 'both'
......@@ -881,12 +882,21 @@
}
if (value !== this.options.selectAllValue && text) {
// By default lets assume that element is not
// interesting for this search.
var showElement = false;
if (this.options.enableCaseInsensitiveFiltering && filterCandidate.toLowerCase().indexOf(this.query.toLowerCase()) > -1) {
showElement = true;
if (this.options.enableCaseInsensitiveFiltering) {
filterCandidate = filterCandidate.toLowerCase();
this.query = this.query.toLowerCase();
}
if( this.options.enableFullValueFiltering && this.options.filterBehavior !== 'both' ) {
var valueToMatch = filterCandidate.trim().substring(0, this.query.length);
if( this.query.indexOf(valueToMatch) > -1 ){
showElement = true;
}
}
else if (filterCandidate.indexOf(this.query) > -1) {
showElement = true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment