Quantcast
Channel: Telerik Forums RSS
Viewing all articles
Browse latest Browse all 78072

Custom Editor throwing js error after "Add New Record" clicked.

$
0
0

"Unhandled exception at line 1362, column 66 in Function code

0x800a1391 - JavaScript runtime error: 'ParameterSet' is undefined."

I'm going to include as little code as possible to demonstrate what things look like:

>>View <<

@(Html.Kendo().Grid<Web.Models.ModelingJobViewModel>()
...
 columns.Bound(c => c.ParameterSet).ClientTemplate("#=ParameterSet.Name#");
...

>>View Model <<

public class ModelingJobViewModel
...
   [UIHint("ParameterSetEditor")]
   public JobParameterSetViewModel ParameterSet {get; set;}
...

>> "Property" view model <<

public class JobParameterSetViewModel
...
   public int Id {get; set;}
   public string Name {get; set;}
...

>> Controller <<

...
  public ActionResult Index()
...
   ViewData["parameterSets"] = repo.SelectAll().Select(e=>new DropdownListItem() { Name = e.name, Id = e.Id}).OrderBy(e => e.Name);
...

>> Custom Editor (ParameterSetEditor) <<
@model Web.Models.ModelingJobViewModel

@(Html.Kendo().DropDownListFor(m => m)
    //.Name("ParameterSet")
    .DataValueField("Id")
    .DataTextField("Name")
    .BindTo((System.Collections.IEnumerable)ViewData["parameterSets"])
)

The initial view and the edit action buttons work fine.  But when "Add" is clicked, I get the error listed above.

It's probably something stupid, but I've spun my wheels long enough and need to throw this out into the forum to see if anyone has an answer. Help!

Thanks in advance!

 


Viewing all articles
Browse latest Browse all 78072

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>