ypeUser | Active |
Administrator | Yes |
Description: Administrator Active: Yes Operations: ( ) 01 ( ) 01 ( ) 01 ( ) 01 ( ) 01 Reports: ( ) 02 ( ) 02 ( ) 02 ( ) 02 ( ) 02 Save Cancel |
@(Html.EJ().Grid<object>("Grid")
.EditSettings(edit => edit.AllowAdding().AllowDeleting().AllowEditing().EditMode(EditMode.DialogTemplate).DialogEditorTemplateID("#template")) .Columns(col =>
{
col.Field("OrderID").IsPrimaryKey(true).Add();
col.Field("CustomerID").Add();
col.Field("Freight").Add();
})
.ClientSideEvents(events => events.ActionComplete("actionComplete"))
)
<script type="text/template" id="template">
<b>Order Details</b>
<table cellspacing="10">
<tr>
<td style="text-align: right;">
Order ID
</td>
<td style="text-align: left">
<input id="OrderID" name="OrderID" value="{{: OrderID}}" disabled="disabled" class="e-field e-ejinputtext valid e-disable"
style="text-align: right; width: 116px; height: 28px" />
</td>
<td style="text-align: right;">
Customer ID
</td>
<td style="text-align: left">
<input id="CustomerID" name="CustomerID" value="{{: CustomerID}}" class="e-field e-ejinputtext valid"
style="width: 116px; height: 28px" />
</td>
</tr>
<tr>
<td style="text-align: right;">
Freight
</td>
<td style="text-align: left">
<input type="text" id="Freight" name="Freight" value="{{:Freight}}" />
</td>
</tr>
<tr>
<td style="text-align: right;">
Ship City
</td>
<td style="text-align: left">
<input id="ShipCity" name="ShipCity" value="{{: ShipCity}}" class="e-field e-ejinputtext valid"
style="width: 116px; height: 28px" />
</td>
<td style="text-align: right;">
Ship Name
</td>
<td style="text-align: left">
<input id="ShipName" name="ShipName" value="{{: ShipName}}" class="e-field e-ejinputtext valid"
style="width: 116px; height: 28px" />
</td>
</tr>
</table>
</script> |
<script>
function actionComplete(args) {
if (args.requestType == "beginedit" || args.requestType == "add") {
$("#Freight").ejNumericTextbox({ value: parseFloat($("#Freight").val()), width: "116px", height: "28px", decimalPlaces: 2 });
if (args.requestType == "beginedit") {
$("#OrderID").attr("disabled", "disabled");
}
}
}
</script>
|