I am trying to put an AutoComplete field into a GridEdit Pop-up dialog. I am using a custom template to format the listbox. The problem is that the listbox shows everything as 'undefined'. If I then click on a listbox item, the correct underlying value is selected and displayed properly.
If I copy the code, take it out of the PopUp editor, and paste it directly into the parent View, then it works perfectly.
Something else I tried...
If I remove the Template altogether than the listbox displays the correct value. I just lose my custom formatting.
I've narrowed the problem down to being the Template. I'm certain that there is something special you have to do with your Template if you are in a Pop-up dialog. The data is not being binded correctly.
What should I do to make the Template work right?
If I copy the code, take it out of the PopUp editor, and paste it directly into the parent View, then it works perfectly.
Something else I tried...
If I remove the Template altogether than the listbox displays the correct value. I just lose my custom formatting.
I've narrowed the problem down to being the Template. I'm certain that there is something special you have to do with your Template if you are in a Pop-up dialog. The data is not being binded correctly.
What should I do to make the Template work right?
@(Html.Kendo().AutoComplete()
.Name("DiaryCodeAutoComplete")
.Filter("startswith")
.Placeholder("Select diary code...")
.DataTextField("Code")
.DataSource(source =>
{
source.Read(read =>
{
read.Action("GetSelectList", "DiaryCode");
});
})
.Template("<
span
style
=
'font-weight: bold;'
>${data.Code}</
span
> <
span
style
=
'float:right'
>${data.Name}</
span
>")
)