Skip to content

Instantly share code, notes, and snippets.

@krizajb
Last active Dec 12, 2019
Embed
What would you like to do?
function filterList(componentName, label, filter) {
let component = PF(componentName),
itemLabel = label.toLocaleLowerCase(),
item = $(component.items)
.filter(function () {
return $(this).data('label').toString().toLocaleLowerCase() === itemLabel;
})
.first();
if (item === undefined) {
return false;
}
let value = $(item.children().last()).html().toString().trim().toLocaleLowerCase();
return value.startsWith(filter);
}
function filterApplicant(label, filter) {
return filterList('widget_mainTab_applicantForm_countryCodeApplicant', label, filter);
}
<p:selectOneMenu
filter="true"
filterFunction="filterApplicant">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment