Howdy.
I'm getting an error when trying to run a template, and I can't seem to figure out what my problem is.
I keep getting this error; Uncaught Error: Invalid template:
I've also tried this based on another post, but I still got the error
So, what am I doing wrong here? This is killing me.
I'm getting an error when trying to run a template, and I can't seem to figure out what my problem is.
<
script
id
=
"HuddleGroupTemplate"
type
=
"text/x-kendo-template"
>
<
select
id
=
"#UserName"
class
=
"multiselect"
multiple
=
"multiple"
name
=
"UserName"
>
# for (var i = 0; i <
data.length
; i++) { #
<option
value
=
"#=data[i].UserName#"
id
=
"#=data[i].UserID#"
selected
=
""
>#=data[i].FirstName# #=data[i].FirstName#</
option
>
# } #
</
select
>
</
script
>
$(document).ready(
function
() {
var
Person = [
{ UserName :
"jeremy@gmail.com"
,
FirstName:
"Jeremy"
,
LastName:
"Mills"
,
UserID:
"1"
,
selected:
true
},
{ UserName :
"jgop@yahoo.com"
,
FirstName:
"Josh"
,
LastName:
"Howard"
,
UserID:
"2"
,
selected:
false
},
{ UserName :
"johnny@gmail.com"
,
FirstName:
"John"
,
LastName:
"Doe"
,
UserID:
"3"
,
selected:
false
}
];
var
HuddleGroupTemplate = kendo.template($(
"#HuddleGroupTemplate"
).html());
var
result = HuddleGroupTemplate(Person);
$(
"#UserName"
).html(result);
});
I keep getting this error; Uncaught Error: Invalid template:
I've also tried this based on another post, but I still got the error
<script id=
"HuddleGroupTemplate"
type=
"text/x-kendo-template"
>
<select id=
"#UserName"
class=
"multiselect"
multiple=
"multiple"
name=
"UserName"
>
# for (var i = 0; i < data.length; i++) { #
<option value=
"data[i].UserName"
id=
"data[i].UserID"
selected=
""
>data[i].FirstName data[i].FirstName</option>
# } #
</select>
</script>
So, what am I doing wrong here? This is killing me.