<script type="text/template" id="templateMaintenance">Changes Required (if possible)
<div style="text-align:center">
<b>Document Details</b>
<table cellspacing="10">
<tr>
<td style="text-align: right;">
File Name
</td>
<td style="text-align: left">
<input id="Name" name="Name" value="{{: Name}}" disabled="disabled" class="e-field e-ejinputtext valid e-disable"
style="text-align: right; width: 116px; height: 28px" />
</td>
<td style="text-align: right;">
Document #
</td>
<td style="text-align: left">
<input id="DocumentNumber" name="DocumentNumber" value="{{: DocumentNumber}}" class="e-field e-ejinputtext valid"
style="width: 116px; height: 28px" />
</td>
</tr>
<tr>
<td style="text-align: right;">
Document Title
</td>
<td style="text-align: left">
<input id="DocumentTitle" name="DocumentTitle" value="{{: DocumentTitle}}" class="e-field e-ejinputtext valid"
style="text-align: right; width: 116px; height: 28px" />
</td>
<td style="text-align: right;">
Revision Number
</td>
<td style="text-align: left">
<input id="DocumentRevisionNumber" name="DocumentRevisionNumber" value="{{: DocumentRevisionNumber}}" class="e-field e-ejinputtext valid"
style="width: 116px; height: 28px" />
</td>
</tr>
<tr>
<td style="text-align: right;">
Document Page Size
</td>
<td style="text-align: left">
<select id="PageSizeId" name="PageSizeId"></select>
</td>
<td style="text-align: right;">
Area
</td>
<td style="text-align: left">
<select id="AreaId" name="AreaId"></select>
</td>
</tr>
<tr>
<td style="text-align: right;">
Document Category
</td>
<td style="text-align: left">
<select id="DocumentCategoryId" name="DocumentCategoryId"></select>
</td>
<td style="text-align: right;">
Document Status
</td>
<td style="text-align: left">
<select id="DocumentStatusId" name="DocumentStatusId"></select>
</td>
</tr>
<tr>
<td style="text-align: right;">
Tags
</td>
<td style="text-align: left">
<input id="Tags" name="Tags" value="{{: Tags}}" class="e-field e-ejinputtext valid"
style="text-align: right; width: 116px; height: 28px" />
</td>
<td style="text-align: right;">
Comments
</td>
<td style="text-align: left">
<textarea id="Comments" name="Comments" class="e-ejinputtext" value="{{: Comments}}">{{: Comments}}</textarea>
<!--<input id="Comments" name="Comments" value="{{: Comments}}" class="e-field e-ejinputtext valid"
style="width: 116px; height: 28px" />-->
</td>
</tr>
<tr>
<td style="text-align: right;">
Transmittal Number
</td>
<td style="text-align: left">
<input id="TransmittalNumber" name="TransmittalNumber" value="{{: TransmittalNumber}}" class="e-field e-ejinputtext valid"
style="text-align: right; width: 116px; height: 28px" />
</td>
<td style="text-align: right;">
Pages
</td>
<td style="text-align: left">
<input type="text" id="NumberOfPages" name="NumberOfPages" value="{{: NumberOfPages}}" />
</td>
</tr>
</table>
</div>
</script>
<tr><td style="text-align: right;">
@(Html.EJ().Grid<SyncfusionMvcApplication8.OrdersView>("FlatGrid")
.EditSettings(edit => { edit.AllowAdding().AllowDeleting().AllowEditing().EditMode(EditMode.DialogTemplate).TitleColumn("CustomerID").DialogEditorTemplateID("#template"); })
..
) |
<script type="text/javascript">
function complete(args) {
if ((args.requestType == "beginedit" || args.requestType == "add") && args.model.editSettings.editMode == "dialogtemplate") {
$("#" + this._id + "_dialogEdit").ejDialog({ title: "Details of File Name" });
// FlatGrid is Grid id
$("#EditDialog_FlatGrid_Save").ejButton("destroy");
$("#EditDialog_FlatGrid_Save").addClass('btn-success btn');
$("#EditDialog_FlatGrid_Save").css({ "width": "100px", "height": "50px", "margin-left": "100px" });
$("#EditDialog_FlatGrid_Cancel").ejButton("destroy");
$("#EditDialog_FlatGrid_Cancel").addClass('btn-success btn');
$("#EditDialog_FlatGrid_Cancel").css({ "width": "100px", "height": "50px", "margin-left": "10px" })..
}
}
}
$("#EditDialog_FlatGrid_Save").click(function () {
var obj = $("#FlatGrid").ejGrid("instance");
obj.endEdit();
});
$("#EditDialog_FlatGrid_Cancel").click(function () {
var obj = $("#FlatGrid").ejGrid("instance")
obj.cancelEdit();
});
</script> |
@(Html.EJ().Grid<SyncfusionMvcApplication8.OrdersView>("FlatGrid")
..
.Columns(col =>
{
..
col.Field("Freight").HeaderText("Freight").TextAlign(TextAlign.Right).Width(75).EditType(EditingType.Numeric).Format("{0:C}").Add();
..
})
.ClientSideEvents(eve => { eve.ActionComplete("complete"); })
)
<script type="text/template" id="template">
<b>Order Details</b>
<table cellspacing="10">
..
<td style="text-align: right;">
Freight
</td>
<td style="text-align: left">
<input type="text" id="Freight" name="Freight" value="{{:Freight}}" />
</td>
..
</script>
function complete(args) {
if ((args.requestType == "beginedit" || args.requestType == "add") && args.model.editSettings.editMode == "dialogtemplate") {
..
$("#Freight").ejNumericTextbox({ value: parseFloat($("#Freight").val()), width: "116px", height: "28px", decimalPlaces: 2 });
..
}
}
} |
$("#EditDialog_GridDocumentMaintenance_Save").ejButton("destroy");$("#EditDialog_GridDocumentMaintenance_Save").addClass('btn btn-success btn-sm');
<script type="text/javascript"> function complete(args) { if ((args.requestType == "beginedit" || args.requestType == "add") && args.model.editSettings.editMode == "dialogtemplate") { $("#EditDialog_FlatGrid_Save").ejButton("destroy"); $($("#EditDialog_FlatGrid_Save").hide()).after('<button id="save" type="button" onclick="savess();" class="btn btn-success btn-sm" > <span class="glyphicon glyphicon-save"></span> Save</button>'); $("#save").css({ "width": "100px", "height": "50px", "font-size": "17px", "margin-left": "190px" }); $("#EditDialog_FlatGrid_Cancel").ejButton("destroy"); $($("#EditDialog_FlatGrid_Cancel").hide()).after(' <button type="button" id="cancel" onclick="cancelss()" class="btn btn-success btn-sm" ><span class="glyphicon glyphicon-remove-circle"></span> Cancel</button>'); $("#cancel").css({ "width": "100px", "height": "50px", "margin-left": "10px" }) .. } } } function savess() { var obj = $("#FlatGrid").ejGrid("instance"); obj.endEdit(); } function cancelss(){ var obj = $("#FlatGrid").ejGrid("instance") obj.cancelEdit(); } </script> |