<div class="control-section">
@(
@Html.EJS().Grid<gridmvclocalization.Controllers.OrdersDetails>("Grid").DataSource((IEnumerable<object>)ViewBag.dataSource).Columns(col =>
{
. . . . . . . .
col.HeaderText("Inupt1").TextAlign(Syncfusion.EJ2.Grids.TextAlign.Center).Template("#template").Width("160").Add();
. . . . . . . .
}).AllowPaging().QueryCellInfo("template").EditSettings(edit => { edit.AllowAdding(true).AllowEditing(true).AllowDeleting(true).Mode(Syncfusion.EJ2.Grids.EditMode.Normal); }).Toolbar(new List<string>() { "Add", "Edit", "Delete", "Update", "Cancel" }).PageSettings(page => page.PageCount(2)).Render()
)
</div>
<script type="text/x-template" id="template">
<input type="text" class="list" id="OrderID${OrderID}" />
</script>
<script>
document.getElementById("Grid").addEventListener("keydown", function (args) {
if (args.keyCode === 9 && args.key === "Tab") {
args.stopImmediatePropagation();
}
});
</script>
<script type="text/javascript">
function template(args) {
if (args.column.headerText === "Inupt1") {
var ele = args.cell.querySelector('.list');
var inputtext = new ej.inputs.TextBox({
value: args.data.ShipCountry,
floatLabelType: 'Auto'
});
inputtext.appendTo(ele);
}
}
</script>
|