Hi
I have a grid defined as :
@(Html.EJ().Grid<Enquiry_History>("Grid")
.Datasource(ds => ds.URL(@Url.Action("DataSource", new { id = Model.ID }))
.CrudURL(@Url.Action("CrudUpdate", new { id = Model.ID }))
.Adaptor(AdaptorType.UrlAdaptor))
.AllowPaging()
.EditSettings(edit => { edit.AllowAdding().AllowDeleting().AllowEditing().EditMode(EditMode.Dialog); })
.ToolbarSettings(toolbar =>
{
toolbar.ShowToolbar().ToolbarItems(items =>
{
items.AddTool(ToolBarItems.Add);
items.AddTool(ToolBarItems.Edit);
items.AddTool(ToolBarItems.Delete);
items.AddTool(ToolBarItems.Update);
items.AddTool(ToolBarItems.Cancel);
});
})
.Columns(col =>
{
col.Field("ID" ).Visible(false).IsPrimaryKey(true).Add();
col.Field("Enquiry_id").Visible(false).Add();
col.Field("Course_type_id" ).HeaderText("Course Type").ForeignKeyField("value").ForeignKeyValue("text").DataSource((IEnumerable<object>)ViewBag.Course_types).Add();
col.Field("No_of_delegates").HeaderText("Delegates").TextAlign(TextAlign.Left).Add();
col.Field("Comment").HeaderText("Comment").AllowEditing(true).Template(true).TemplateID("#columnTemplate").Add();
})
)
My JS is
<script type="text/x-jsrender" id="columnTemplate">
<textarea rows="4" cols=95%>{{:Comment}}</textarea>
</script>
The dialog edit box shows up correctly but when I press save the record received at the controller has the comment field set to null all other fields can be edited correctly.
What am I doing wrong
Regards
Martin