I am generating the NEW CHIP List when the user changes the value from the dropdown list.
When I run the page --> First-time page load display all the CHIPS --> Change the value from Dropdown--> New Chip list generates.
Here is the dropdown value, when I change the DROPDOWN value the new chip list gets generated.
<select class="form-control" id="selectTrainer" onchange="getTeacher(this)">
<option value="All">All</option>
@foreach (var teacherDeatails in ViewBag.datasourceTeacher)
{
<option value="@ teacherDeatails.ID">@ teacherDeatails .Name</option>
}
</select>
Here is the chip list which gets display the FIRST TIME when the page LOAD.
<div class="sample-padding">
<ejs-chiplist id="divChipData" selection="Single" click="FilterChipData">
<e-chips>
@foreach (var product in (List<FilterTagInfo>)ViewBag.VBFilterTags)
{
<e-chip text="@product.Name" value="@product.ID" enabled="true"></e-chip>
}
</e-chips>
</ejs-chiplist>
</div>
Here In the newly generated chip list, I want to apply the CSS here when you click on any newly generated chip.
new ej.buttons.ChipList({
chips: newChipBind, selection: "Single", click: function (e) {
alert('you have clicked ' + e.text);
document.querySelector('.e-chip-list').classList.add(".e-selection");
FilterChipData(e);
}}, '#divChipData');