Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
141209 | Nov 29,2018 04:29 PM UTC | Dec 4,2018 07:23 AM UTC | ASP.NET MVC - EJ 2 | 5 |
![]() |
Tags: Grid |
@Html.EJS().Toolbar("defaultToolbar").Created("created").Items(new List<ToolbarItem> {
…
new ToolbarItem { Text = "Input", Template= "<input id='numeric' type='text'/>" }, // Element
}).Render()
<script>
function created() {
var numeric = new ej.inputs.NumericTextBox({
format: 'c2',
value: 1,
width: 150
});
numeric.appendTo('#numeric'); // Render numeric text box
}
</script> |
@{
List<object> toolbarItems = new List<object>();
toolbarItems.Add(new
{
id = "template",
text = "Input",
template = "<input id='numeric' type='text'/>"
});
}
@Html.EJS().Grid("Grid").Created("created").DataSource((IEnumerable<object>)ViewBag.dataSource).Columns(col =>
{
col.Type("checkbox").Width("50").Add();
col.Field("OrderID").HeaderText("Order ID").IsPrimaryKey(true).Width("120").TextAlign(Syncfusion.EJ2.Grids.TextAlign.Right).Add();
. . . .
col.Field("ShipName").HeaderText("Ship Name").Width("150").Add();
}).AllowResizing().ToolbarClick("toolbarClick").Toolbar(toolbarItems).AllowPaging().PageSettings(page => page.PageCount(5)).EditSettings(edit => {edit.AllowEditing(true).Mode(Syncfusion.EJ2.Grids.EditMode.Normal); }).
Render()
<script>
function toolbarClick(args) {
if (args.item.id === 'template') {
alert("template");
}
}
</script>
<script>
function created() {
var numeric = new ej.inputs.NumericTextBox({
format: 'c2',
value: 1,
width: 150
});
numeric.appendTo('#numeric'); // Render numeric text box
}
</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.