Potentially related:
<e-column
field="difficulty"
headerText="{{'NIVEAU'|uppercase}}"
textAlign="left"
[filterBarTemplate]="templateOptionsDropDownDifficulty"
></e-column>
public _templateOptionsDropDownDifficulty: IFilterUI = {};
public get templateOptionsDropDownDifficulty(): IFilterUI | undefined {
return this._templateOptionsDropDownDifficulty;
}
onInit:
this._templateOptionsDropDownDifficulty = {
create: () => {
this.dropdownDifficulty = document.createElement('select');
if (this.dropdownDifficulty) this.dropdownDifficulty.id = 'NIVEAU';
this.dropdownDifficulty?.replaceChildren();
const option = document.createElement('option');
option.value = '';
option.innerText = 'tout';
this.dropdownDifficulty?.appendChild(option);
this.difficultyDistinctData
.forEach((item: object) => {
const option = document.createElement('option');
option.value = (item as ItemType).difficulty;
option.innerText = (item as ItemType).difficulty;
(this.dropdownDifficulty as HTMLElement).appendChild(option);
});
return this.dropdownDifficultyGetter;
},
write: () => {
const dropdownlist = new DropDownList({
change: this.dropdownFunctionDifficulty.bind(this),
});
dropdownlist.appendTo(this.dropdownDifficulty);
},
};
and after the user picks an option from a different filterBarTemplate:
this._templateOptionsDropDownDifficulty = {
create: () => {
this.dropdownDifficulty = document.createElement('select');
if (this.dropdownDifficulty) this.dropdownDifficulty.id = 'NIVEAU';
this.dropdownDifficulty?.replaceChildren();
const option = document.createElement('option');
option.value = '';
option.innerText = 'tout';
this.dropdownDifficulty?.appendChild(option);
if (this.selectedCompetency) {
this.currentCompetency = (this.competencies ?? [])?.find(
(competency) => competency.name === this.selectedCompetency,
) as CompetenceDetail;
console.log('currentCompetency: ', this.currentCompetency);
(
this.currentCompetency as CompetenceDetail & {
groupDifficultyLevels: { name: string }[];
}
).groupDifficultyLevels
.forEach((item: object) => {
const option = document.createElement('option');
option.value = (item as ItemType).id;
option.innerText = (item as ItemType).name;
(this.dropdownDifficulty as HTMLElement).appendChild(option);
});
}
return this.dropdownDifficultyGetter;
},
write: () => {
const dropdownlist = new DropDownList({
change: this.dropdownFunctionDifficulty.bind(this),
});
dropdownlist.appendTo(this.dropdownDifficulty);
},
};
Hi Ryan Costache,
We have reviewed your query and shared relevant feedback. Based on our understanding, you want to filter the data dynamically by selecting a dropdown option. We have successfully created a sample that meets your requirements.
Sample : Syncfusion-content - Ej2 Angular Docs (forked) - StackBlitz
If this does not
meet your requirements, Kindly provide the following details:
The above-requested details will be very helpful for us to validate the reported query at our end and provide the solution as early as possible.
Regards,
Johnson Soundararajan S