Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
149327 | Nov 21,2019 09:34 PM UTC | Nov 22,2019 01:10 PM UTC | ASP.NET MVC - EJ 2 | 1 |
![]() |
Tags: Grid |
Index.cshtml
@{
List<object> toolbarItems = new List<object>();
toolbarItems.Add(new { text = "Menu", template = "#menuitem" });
}
<div id="menuitem"> // div element is created
<ul class="menu" id="tool_menu"></ul>
</div>
@Html.EJS().Grid("grid").DataSource((IEnumerable<object>)ViewBag.DataSource).
ShowColumnChooser(true).AllowPaging(true).
…
}).Created("created").Toolbar(toolbarItems).AllowPaging().Render()
<script>
function created() {
var menuItems = [
{
text: 'Items',
iconCss: 'e-icons MT_menu1',
items: [
{ text: 'Item 1' }, // items in the Menu
{ text: 'Item 2' },
{ text: 'Item 3' },
]
}
];
var menuObj = new ej.navigations.Menu({ items: menuItems, select: onMenuSelect }); //Menu is created
menuObj.appendTo("#tool_menu"); // Menu is append to created div element
}
function onMenuSelect(args) {
// Triggers on selecting menu item
}
</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.