Answer the question
In order to leave comments, you need to log in
How to fix filtering in Angular?
There is a filter with string values:
vm.filteredPartners = ["COMPANY", "BRANCH", "PERSON"];
vm.properties = [
{ title: "Юр. лицо", value: PartnersTypeConstants.Properties.COMPANY, isSelected: false },
{ title: "Обособленное подразделение", value: PartnersTypeConstants.Properties.BRANCH, isSelected: false },
{ title: "Физ. лицо", value: PartnersTypeConstants.Properties.PERSON, isSelected: false }
];
function setPropertyShortName(propertySelection) {
//vm.selectedValue = !propertySelection.isSelected ? propertySelection.value : undefined;
for (var i = 0; i < vm.properties.length; i++) {
if (vm.properties[i].value === vm.filteredPartners.value) {
vm.properties[i].isSelected = propertySelection.isSelected;
continue;
}
vm.properties[i].isSelected = false;
}
search(true);
}
Answer the question
In order to leave comments, you need to log in
vm.properties = [
{ title: "ЮЛ", value: PartnersTypeConstants.Properties.COMPANY, isSelected: false },
{ title: "ОП", value: PartnersTypeConstants.Properties.BRANCH, isSelected: false },
{ title: "ФЛ", value: PartnersTypeConstants.Properties.PERSON, isSelected: false }
];
vm.selectedValue = [];
//vm.filter.partnerTypes = vm.filteredPartners;
function setPropertyShortName(propertySelection) {
vm.filteredPartners = propertySelection.isSelected ? propertySelection.value : undefined;
for (var i = 0; i < vm.properties.length; i++) {
if (vm.properties[i].value === propertySelection.value) {
vm.properties[i].isSelected = propertySelection.isSelected;
//continue;
}
}
search(true);
}
it turns out that the function does not return the selected value
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question