I have an application, if I have child elements to the particular list, then I have a button towards left. If I click on that I find a list of child elements. Now if I keyin any alphabet in the search field or select an alphabet from the alphabets, then the child elements don't show even though the child elements start with that alphabet. Can anyone help me to sort out this issue?
I have the same issue solved in DEMO2, but I am not able to figure out where I am going wrong.
For example: I have Testing_15
, I have a button towards left of it, if I click on that it shows sadasd ( Payer Office)
, but I want the same to be shown when I click on "S" in the alphabet or type "S/s" in the search filter box.
DEMO 1 : DEMO 1
DEMO 2: DEMO 2
TS:
searchFacility(search) {
this.sLetter = search;
let memberFacilities = true;
if (search) {
this.dtFacilities.expandedRows = [];
setTimeout(() => {
this.dtFacilities.expandedRows = this.dtFacilities.value;
this.dtFacilities.value.forEach(m => {
m.memberFacilities.forEach(f => {
let mySearch = search.toLowerCase();
let facilityName = f.facilityName.toLowerCase();
if (facilityName && facilityName.includes(mySearch)) {
f.isShowMember = false;
memberFacilities = false;
} else {
f.isShowMember = true;
}
})
})
if (memberFacilities) {
this.dtFacilities.expandedRows = [];
}
}, 100);
}
else {
this.dtFacilities.expandedRows = [];
this.dtFacilities.value.forEach(m => {
m.memberFacilities.map(f => {
f.isShowMember = false;
})
})
}
if(search==''){
this.searchFname="";
}
}