<script type="text/template" id="template">
<b>Order Details</b>
<table cellspacing="10">
<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}}" />
<button type="button" id="btnsearch" class="btn btn-info">...</button>
</td>
</tr>
</table>
</script>
<ej:Dialog ID="Dialog" ClientIDMode="Static" ShowOnInit="false" EnableModal="true" Target="#OrdersGrid" runat="server" Title="SearchGrid">
<DialogContent>
<ej:Grid ID="PopupGrid" AllowPaging="true" runat="server" ClientIDMode="Static">
<PageSettings PageSize="3" />
<Columns>
<ej:Column Field="ShipName" />
</Columns>
<ClientSideEvents RowSelected="rowSelected" />
</ej:Grid>
</DialogContent>
</ej:Dialog>
<ej:Grid ID="OrdersGrid" ClientIDMode="Static" runat="server">
. . .
</ej:Grid>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<script type="text/template" id="template">
<b>Order Details</b>
<table cellspacing="10">
. . .
. .
<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}}" />
<button id="btn" type="button" class="btn btn-info">...</button>
</td>
</tr>
</table>
</script>
<script type="text/javascript">
function complete(args) {
. . .
if ((args.requestType == "beginedit" || args.requestType == "add")) {
. . .
$("#btn").ejButton({
text: "...",
click: function (args) {
$("#Dialog").ejDialog("open");
}
})
} }
}
function rowSelected(args) {
$("#ShipName").val(args.data.ShipName).text(args.data.ShipName);
$("#Dialog").ejDialog("close");
}
</script> |