mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-14 09:58:16 +01:00
Enhancement to r45442 so search options provided as a list are still filtered, but server response is accepted unfiltered.
Fixes search options provided as a static list were not being filtered.
This commit is contained in:
parent
4f2f64fcbe
commit
62686e4b2a
@ -1089,13 +1089,14 @@
|
|||||||
filtered = [],
|
filtered = [],
|
||||||
newSuggestions = [],
|
newSuggestions = [],
|
||||||
selectedValues = ms.getValue();
|
selectedValues = ms.getValue();
|
||||||
|
var server_search = typeof cfg.data == 'string' && cfg.data.indexOf(',') < 0
|
||||||
// filter the data according to given input
|
// filter the data according to given input
|
||||||
if(q.length > 0) {
|
if(q.length > 0) {
|
||||||
$.each(data, function(index, obj) {
|
$.each(data, function(index, obj) {
|
||||||
var name = obj[cfg.displayField];
|
var name = obj[cfg.displayField];
|
||||||
if((cfg.matchCase === true && name.indexOf(q) > -1) ||
|
if((cfg.matchCase === true && name.indexOf(q) > -1) ||
|
||||||
(cfg.matchCase === false && name.toLowerCase().indexOf(q.toLowerCase()) > -1) ||
|
(cfg.matchCase === false && name.toLowerCase().indexOf(q.toLowerCase()) > -1) ||
|
||||||
cfg.strictSuggest === false) {
|
cfg.strictSuggest === false && server_search) {
|
||||||
if(cfg.strictSuggest === false || name.toLowerCase().indexOf(q.toLowerCase()) === 0) {
|
if(cfg.strictSuggest === false || name.toLowerCase().indexOf(q.toLowerCase()) === 0) {
|
||||||
filtered.push(obj);
|
filtered.push(obj);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user