Aug 28, 2012, 7:48 PM
[CLOSED] GridPanel, MVC, Editor
Is there a way to use the "editorFor" construction when building out a GridPanel in Razor? For example, I have this grid:
@(Html.X.GridPanel().ID("grdCedents") _
.Layout(LayoutType.Fit) _
.SortableColumns(False) _
.EnableColumnHide(False) _
.MinWidth(500) _
.Border(True) _
.ColumnModel(Sub(action)
action.Add(Html.X.Column().Text(" ").Width(30))
action.Add(Html.X.Column().Text("Client Name").DataIndex("ClientName").Width(230))
action.Add(Html.X.Column().Text("Code").DataIndex("Code").Width(50).Align(Alignment.Right))
action.Add(Html.X.DateColumn().Text("Unsigned<br/>Doc Sent").DataIndex("UnsignedDocSent").Align(Alignment.Right))
action.Add(Html.X.DateColumn().Text("Signed<br/>Doc Sent").DataIndex("SignedDocSent").Align(Alignment.Right))
action.Add(Html.X.DateColumn().Text("Signed<br/>Doc Received").DataIndex("SignedDocReceived").Align(Alignment.Right))
action.Add(Html.X.CheckColumn().Text("Track<br/>Dates").DataIndex("TrackDates").Width(50).Align(Alignment.Center))
action.Add(Html.X.CheckColumn().Text("Never<br/>Signing").DataIndex("NeverSigning").Width(50).Align(Alignment.Center))
End Sub) _
.Store(Sub(action)
action.Add(Html.X.Store().ID("docCedentStore").AutoLoad(True).DataSource(Model.CedentInformation) _
.Model(Sub(mdl)
mdl.Add(Html.X().Model.Fields(Sub(fields)
fields.Add(Html.X.ModelField.Name("ClientName"))
fields.Add(Html.X.ModelField.Name("Code"))
fields.Add(Html.X.ModelField.Name("SignedDocReceived").Type(ModelFieldType.Date))
fields.Add(Html.X.ModelField.Name("SignedDocSent").Type(ModelFieldType.Date))
fields.Add(Html.X.ModelField.Name("UnsignedDocSent").Type(ModelFieldType.Date))
fields.Add(Html.X.ModelField.Name("TrackDates").Type(ModelFieldType.Boolean))
fields.Add(Html.X.ModelField.Name("NeverSigning").Type(ModelFieldType.Boolean))
End Sub))
End Sub) _
.PageSize(20).RemotePaging(False) _
)
End Sub)
)
For the date columns, is there any way to use this type of construct:.Editor(html.X.EditorFor(function (model) model.MyDataCollection(currentOne).UnsignedDocSent))
If not, what is the best practice way to build out the editor in Razor?
Last edited by Daniil; Aug 30, 2012 at 6:12 PM.
Reason: [CLOSED]