@(Html.EJ().Grid<object>("Grid") .Datasource((IEnumerable<object>)ViewBag.dataSource1) .EditSettings(edit => { edit.AllowAdding().AllowDeleting().AllowEditing().EditMode(EditMode.ExternalFormTemplate).ExternalFormTemplateID("#template"); }) .Columns(col => { ... }) .ClientSideEvents(eve => eve.ActionComplete("complete")) ) @(Html.EJ().ScriptManager()) <script id="template" type="text/template"> <b>Order Details</b> ... <td style="text-align: right;"> OrderDate </td> <td style="text-align: left"> <input id="OrderDate" name="OrderDate" value="{{:OrderDate}}" class="e-field e-ejinputtext" placeholder="Choose display end date" /> </td> </tr> </table> </script> <script> function complete(args) { if ((args.requestType == "beginedit" || args.requestType == "add") && args.model.editSettings.editMode == "externalformtemplate") { ... $("#OrderDate").ejDatePicker({ value: args.rowData.OrderDate }); } } </script> |