Hi,
I've noticed that I get a type error in Javascript whenever I click a cell which has layers of DOM elements.
I get the following error:
> Uncaught TypeError: Cannot read property 'field' of undefined
The table code is as follows:
@( Html.EJ().Grid<DisplayController.Person>("FlatGrid")
.Datasource((IEnumerable<object>)ViewBag.datasource)
.AllowSorting()
.AllowPaging(true)
.PageSettings(p => p.PageSize(2))
.Columns(c =>
{
c.Field("FirstName").HeaderText("First Name").Width(150).Add();
c.Field("LastName").HeaderText("Last Name").Width(150).Template(true).TemplateID("#person-template").Add();
c.Field("Email").HeaderText("Email").Width(150).Add();
})
.DetailsTemplate("#person-detail")
)
<script id="person-template" type="text/template">
<div class="person-content">
<div style="width: 3em; background-color: red; display: inline-block;">:)</div>
<div style="display: inline-block;">{{:LastName}}</div>
</div>
</script>
<script id="person-detail" type="text/template">
<div class="expanded-content">
<div><label style="margin-right: 2em;">Middle name</label><span>{{:MiddleName}}</span></div>
<div><label style="margin-right: 2em;">Pet</label><span>{{:Pet}}</span></div>
</div>
</script>
I get the javascript error when I click on cells in the 'Last name' column. When I simplify the contents of the template to the following, I do not get the error.
<script id="person-template" type="text/template">
<div class="person-content">
{{:LastName}}
</div>
</script>