<ej:Grid ID="OrdersGrid" runat="server" AllowPaging="True" OnServerEditRow="EditEvents_ServerEditRow" OnServerAddRow="EditEvents_ServerAddRow"
OnServerDeleteRow="EditEvents_ServerDeleteRow">
<ClientSideEvents ActionComplete="complete"/>
<Columns>
…………………………………………………………………….
</Columns>
<EditSettings AllowEditing="True" AllowAdding="True" AllowDeleting="True" EditMode="DialogTemplate" DialogEditorTemplateID="#template"></EditSettings>
<ToolbarSettings ShowToolbar="True" ToolbarItems="add,edit,delete,update,cancel"></ToolbarSettings>
</ej:Grid> |
<script type="text/template" id="template">
<div id="apiTab" style="width: 500px">
<ul>
<li><a rel='nofollow' href="#javaScript">Part 1</a></li>
<li><a rel='nofollow' href="#cSharp">Part 2</a></li>
</ul>
<div id="javaScript">
<b>OrderDetails</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>
</table>
</div>
<div id="cSharp">
<table cellspacing="10">
<tr>
<td style="text-align: right;">ShipCountry
</td>
<td style="text-align: left">
<select id="ShipCountry" name="ShipCountry">
<option value="Germany">Germany</option>
<option value="Mexico">Mexico</option>
<option value="UK">UK</option>
<option value="Sweden">Sweden</option>
<option value="France">France</option>
<option value="Italy">Italy</option>
<option value="Spain">Spain</option>
</select>
</td>
</tr>
<tr>
<td style="text-align: right;">ShipName
</td>
<td style="text-align: left">
<input id="ShipName" name="ShipName" class="e-field e-ejinputtext valid"
style="width: 116px; height: 28px" value="{{:ShipName}}" />
</td>
<td style="text-align: right;">EmployeeID
</td>
<td style="text-align: left">
<input id="EmployeeID" name="EmployeeID" class="e-field e-ejinputtext valid"
style="width: 116px; height: 28px" value="{{:EmployeeID}}" />
</td>
</tr>
</table>
</div>
</div>
</script> |
function complete(args) {
if (args.requestType == "refresh" || args.requestType == "save") {
$('#<%= OrdersGrid.ClientID %>').ejWaitingPopup("hide");
}
if ((args.requestType == "beginedit" || args.requestType == "add") && args.model.editSettings.editMode == "dialogtemplate") {
$("#apiTab").ejTab();
……………………………………………………………….
}
}
} |
|
|
<ej:Grid ID="OrdersGrid" runat="server" AllowPaging="True" OnServerEditRow="EditEvents_ServerEditRow" OnServerAddRow="EditEvents_ServerAddRow"
OnServerDeleteRow="EditEvents_ServerDeleteRow">
<ClientSideEvents ActionComplete="complete" ActionBegin="begin"/>
………………………………………………
</ej:Grid>
……………………
function complete(args) {
if (args.requestType == "refresh" || args.requestType == "save") {
$('#<%= OrdersGrid.ClientID %>').ejWaitingPopup("hide");
}
if ((args.requestType == "beginedit" || args.requestType == "add") && args.model.editSettings.editMode == "dialogtemplate") {
$("#apiTab").ejTab();
$("#Freight").ejNumericTextbox({ value: parseFloat($("#Freight").val()), width: "116px", height: "28px", decimalPlaces: 2 });
$("#EmployeeID").ejNumericTextbox({ value: $("#EmployeeID").val(), width: "116px", height: "28px" });
$("#ShipCountry").ejDropDownList({ width: '116px',showCheckbox: true, allowMultiSelection: true, value: args.rowData.ShipCountry });
if (args.requestType == "beginedit") {
$("#OrderID").attr("disabled", "disabled");
$("#ShipCountry").ejDropDownList("setSelectedValue", args.row.children().eq(4).text());
}
}
} |
|
<ej:Grid ID="OrdersGrid" runat="server" AllowPaging="True" OnServerEditRow="EditEvents_ServerEditRow" OnServerAddRow="EditEvents_ServerAddRow"
OnServerDeleteRow="EditEvents_ServerDeleteRow">
<ClientSideEvents ActionComplete="complete" ActionBegin="begin"/>
……………………………………………….
</ej:Grid>
…………………………….
function begin(args) {
if (args.requestType == "save") {
args.data.ShipCountry = args.data.hiddenEle
}
} |
|