-
Notifications
You must be signed in to change notification settings - Fork 26
Description
Hello! thank you for the work you have done. The plugin is very good, here is a small fix to make it even better, this is a case-insensitive search, I gave the entire method, but in fact there is only q.toLowerCase()
`
this.searchShow = function (c, q, items) {
var content = '';
var select = '';
if ($.xtsStore[c].selectablePrernt) {
select = '';
}
for (var ix in items) {
var clsx = ' class="xli" ';
var itm = items[ix];
if (itm[$.xtsStore[c].json.title].toString().toLowerCase().indexOf(q.toLowerCase()) !== -1 || itm[$.xtsStore[c].json.value].toString().indexOf(q.toLowerCase()) !== -1) {
if (itm[$.xtsStore[c].json.child] != undefined && itm[$.xtsStore[c].json.child].length > 0) {
clsx = ' class="xli xtsel-childer" ';
content += '<li' + clsx + ' data-id="' + itm.idx + '" data-value="' + itm[$.xtsStore[c].json.value] + '">' + select + itm[$.xtsStore[c].json.title] + '';
content +=
} else {
content += '<li' + clsx + ' data-id="' + itm.idx + '" data-value="' + itm[$.xtsStore[c].json.value] + '">' + itm[$.xtsStore[c].json.title] + '';
}
} else {
if (itm[$.xtsStore[c].json.child] != undefined && itm[$.xtsStore[c].json.child].length > 0) {
content +=
}
}
}
return content;
}
`