Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
151135 | Jan 31,2020 06:21 PM UTC | Feb 7,2020 07:35 AM UTC | ASP.NET MVC - EJ 2 | 3 |
![]() |
Tags: Grid |
<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>
|
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.