davidstutz / bootstrap-multiselect

JQuery multiselect plugin based on Twitter Bootstrap.
https://davidstutz.github.io/bootstrap-multiselect/
Other
3.66k stars 1.99k forks source link

title attribute search #1251

Open markusd1984 opened 1 year ago

markusd1984 commented 1 year ago

I've added support for searching through title attributes, as titles for tooltip are so useful in multiselect. Perhaps somebody can crease a commit for similar or a better solution.

var title = $(element).attr("title").length > 0 ? $(element).attr("title") : "";

else if ((this.options.filterBehavior === 'title')) {
 filterCandidate = title;
}
else if (this.options.filterBehavior === 'all') {
 filterCandidate = text + '\n' + value + '\n' + title;
}

filterBehavior: 'title' for searching only title attribute or ideally filterBehavior: 'all' to search through text + value + titles.

https://github.com/davidstutz/bootstrap-multiselect/pull/256 https://github.com/davidstutz/bootstrap-multiselect/pull/1007