I have a column configured as below:
.Filterable(f => f.Multi(true)
.CheckAll(true)
.ItemTemplate("itemTemplate")
.Search(true)
.DataSource(ds => ds.Read(r => r.Action("Items_Distinct", "Admin")))
Items_Distinct method is returning a collection (List) of strings.
itemTemplate function is as below:
function itemTemplate(e) {
if (e.field == "all") {
//handle the check-all checkbox template
return "<div><label><strong><input type='checkbox' />#= all#</strong></label></div>";
} else {
//handle the other checkboxes
return "<span><label><input type='checkbox' name='" + e.field + "' value='#=Label#'/> <span>#= Label #</span></label></span><br/>"
}
}
When I run the application and open the filter menu, I get below error:
Uncaught ReferenceError: Label is not defined
at eval (eval at compile (kendo.all.js:309417:87), <anonymous>:3:148)
at Object.render (kendo.all.js:309417:87)
at init.createCheckBoxes (kendo.all.js:309417:87)
at init.refresh (kendo.all.js:309417:87)
at init.checkChangeHandler (kendo.all.js:309417:87)
at init.trigger (kendo.all.js:309417:87)
at init._process (kendo.all.js:309417:87)
at init.success (kendo.all.js:309417:87)
at success (kendo.all.js:309417:87)
at t.success (kendo.all.js:309417:87)
Can someone please point my mistake? I used one of the dojo's as template to develop my itemTemplate function and apparently I did not understand where "Label" is defined. What am I missing?
Thanks.