Last active
December 12, 2019 15:31
-
-
Save krizajb/960e5962802a0ef41bee23c02689fcb9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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