Forum Discussion

ppaily's avatar
ppaily
Copper Contributor
Mar 10, 2024

Trying to create a multi filter column using the Item Template and from the Enum Data not working

I am trying to create a multifilter from Enum data type column using the Item Template. But Item Template JavaScript function is not being called and data is not being shown in combo box. Please can you give me a help. Here is the code

 

 

 

 

public enum EmpTypes
{
    [Display(Name = "Service")]
    Service = 0,
    [Display(Name = "Sales")]
    Sales = 1,
    [Display(Name = "Purchase")]
    Purchase = 2,
    [Display(Name = "Office")]
    Office = 3
}
columns.Bound(c => c.EmpTypes).Title("Type")
        .Filterable(filterable => filterable
            .Multi(true)
            .UI("") .UI(“”).DataSource(s=>s.Read(r=>r.Action(“GetEmpTypes”,”Report”)))
            .ItemTemplate(“typetemplate”));
<script>
 function typetemplate(e)
{
  alert('Test');
}

</script>
Public ActionResult GetEmpTypes()
{
 List<EmpType> emptypes = new List<EmpType>();
emptypes.Add(EmpType.Sales)
emptypes.Add(EmpType.Report)
return Json(emptypes,JsonRequestBehavior.AllowGet);
}

 

 

 

 

 

 

No RepliesBe the first to reply

Resources