Hi all, I hope someone can help on this odd problem I have.
I am performing binding against some objects called Instances.
Each Instance has a couple of strings, and another object called a Hosting Environment.
HostingEnvironment has the LocationName as a string.
So I'm using a ClientTemplate to display LocationName, while binding to the HostingEnvironment for that grid column.
I'm also using a PartialView for displaying the list of HostingEnvironment locations names in a dropdown during an edit.
That all works great, I can view and edit records.
The problem happens as soon as I click the "Create" button... it immediately throws an error:
0x800a1391 - JavaScript runtime error: 'HostingEnvironment' is undefined
When I break into the generated code, I can see that all the strings are blank (a good thing) except HostingEnvironment doesn't have a value (yes it's null)... so I guess the PartialView doesn't like that maybe?
I'm not really sure what to do...
Here's my main view.
@model IEnumerable<Core.Domain.Entities.Instance>
@(Html.Kendo().Grid(Model)
.Name("Instances")
.Columns(columns =>
{
columns.Bound(p => p.InstanceName).Title("Instance Name");
columns.Bound(p => p.InstanceFullName).Title("Instance Full Name");
columns.Bound(p => p.HostingEnvironment);//.Title("Hosting Environment").ClientTemplate("#: HostingEnvironment.LocationName #");
columns.Bound(p => p.SysId);
columns.Command(command => {command.Edit(); command.Destroy(); });
})
.Pageable()
.Sortable()
.Scrollable()
.Filterable()
.ToolBar(commands => commands.Create())
.Editable(editable => editable.Mode(GridEditMode.InLine))
.DataSource(dataSource => dataSource
.Ajax()
.Model(model => model.Id(p => p.SysId))
// Configure CRUD -->
.Create(create => create.Action("CreateNew", "Instance"))
.Read(read => read.Action("Read", "Instance"))
.Update(update => update.Action("Update", "Instance"))
.Destroy(destroy => destroy.Action("Destroy", "Instance"))
// <-- Configure CRUD
)
)
I am performing binding against some objects called Instances.
Each Instance has a couple of strings, and another object called a Hosting Environment.
HostingEnvironment has the LocationName as a string.
So I'm using a ClientTemplate to display LocationName, while binding to the HostingEnvironment for that grid column.
I'm also using a PartialView for displaying the list of HostingEnvironment locations names in a dropdown during an edit.
That all works great, I can view and edit records.
The problem happens as soon as I click the "Create" button... it immediately throws an error:
0x800a1391 - JavaScript runtime error: 'HostingEnvironment' is undefined
When I break into the generated code, I can see that all the strings are blank (a good thing) except HostingEnvironment doesn't have a value (yes it's null)... so I guess the PartialView doesn't like that maybe?
I'm not really sure what to do...
Here's my main view.
@model IEnumerable<Core.Domain.Entities.Instance>
@(Html.Kendo().Grid(Model)
.Name("Instances")
.Columns(columns =>
{
columns.Bound(p => p.InstanceName).Title("Instance Name");
columns.Bound(p => p.InstanceFullName).Title("Instance Full Name");
columns.Bound(p => p.HostingEnvironment);//.Title("Hosting Environment").ClientTemplate("#: HostingEnvironment.LocationName #");
columns.Bound(p => p.SysId);
columns.Command(command => {command.Edit(); command.Destroy(); });
})
.Pageable()
.Sortable()
.Scrollable()
.Filterable()
.ToolBar(commands => commands.Create())
.Editable(editable => editable.Mode(GridEditMode.InLine))
.DataSource(dataSource => dataSource
.Ajax()
.Model(model => model.Id(p => p.SysId))
// Configure CRUD -->
.Create(create => create.Action("CreateNew", "Instance"))
.Read(read => read.Action("Read", "Instance"))
.Update(update => update.Action("Update", "Instance"))
.Destroy(destroy => destroy.Action("Destroy", "Instance"))
// <-- Configure CRUD
)
)