Open trading-developer opened 11 months ago
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 += $.xts.searchShow(c, q.toLowerCase(), itm[$.xtsStore[c].json.child]); } 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 += $.xts.searchShow(c, q.toLowerCase(), itm[$.xtsStore[c].json.child]); } } } return content;
}
`
You can do it with pull request bro
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 += $.xts.searchShow(c, q.toLowerCase(), itm[$.xtsStore[c].json.child]); } 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 += $.xts.searchShow(c, q.toLowerCase(), itm[$.xtsStore[c].json.child]); } } } return content;
`