I am displaying the chip list using the below code and execute the filter event.
<ejs-chiplist id="chip-filterTags" selection="Single" click="FilterClasses" cssClass="e-primary">
<e-chips>
@foreach (var product in (List<FilterTagInfo>)ViewBag.FilterTags)
{
<e-chip text="@product.Name" value="@product.FilterTagID" enabled="true"></e-chip>
}
</e-chips>
</ejs-chiplist>
And here is my filterClasses event.
function FilterClasses(e) {
var FilterTagInfo = {};
FilterTagInfo.FilterTagID = e.data.value;
FilterTagInfo.Name = e.text;
console.log(FilterTagInfo.FilterTagID);
console.log( FilterTagInfo.Name );
}
Now here comes my query. FOR EXAMPLE, CHECK THE BELOW LIST.
LIST:- ALL MATHS SCIENCE GEOGRAPHY ENVIRONMENT
1) When FIRST TIME PAGE RUN AND CLICK ON CHIP, let's say MATHS in console.log, it displays MATHS AND ID OF THE MATHS 5.
2) Now when I, UN-CHECK MATHS, in console.log it again shows me MATHS AND ID OF THE MATHS 5. but I want to fire a condition if the user dis-select the same chip and ALSO NO CHIP is selected then PASS the ID value as 100 and CHIP TEXT as ALL.
<ejs-chiplist id="chip-filterTags" click="FilterClasses" selection="Single">
. . .
</ejs-chiplist>
<script>
function FilterClasses(args) {
if (args.selected == true) { //to check whether the chip is selected or not
var FilterTagInfo = {};
FilterTagInfo.FilterTagID = args.data.value;
FilterTagInfo.Name = args.text;
}
else {
var FilterTagInfo = {};
FilterTagInfo.FilterTagID = 100;
FilterTagInfo.Name = null;
}
}
</script> |
Hello
Shalini,
Thank you very much for the code. I am trying to use the same logic but just forgot the specify the condition related to ==true.
Thanks
Hello
Keerthana,
That is what the reason I generally prefer my Client to USE the synfusion, because of the forum gives me a perfect reply with the example.
Again thank you very much.
Thanks