We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Javascript error when clicking on a cell with DOM layers.

Thread ID:

Created:

Updated:

Platform:

Replies:

118468 Mar 10,2015 07:34 PM Mar 12,2015 06:26 AM ASP.NET MVC 1
loading
Tags: Grid
Rachael
Asked On March 10, 2015 07:34 PM

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>


Ragavee U S [Syncfusion]
Replied On March 12, 2015 06:26 AM

Hi Rachael,

We considered the requirement “Script error is thrown on clicking template cell” as a bug. We have logged a report on this and will fix the issue internally, also the fix will be included in Vol 1, 2015 service pack 1 release, which has been scheduled to be rolled out in the month of April 2015.

We have also created an incident internally to have a follow up with this issue.

Please let us know if you have any queries.

Regards,

Ragavee



CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;