Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
140871 | Nov 12,2018 02:43 PM UTC | Nov 15,2018 09:52 AM UTC | ASP.NET MVC - EJ 2 | 3 |
![]() |
Tags: Grid |
@{
List<object> toolbarItems = new List<object>();
toolbarItems.Add("Search");
toolbarItems.Add(new { text = "Expand All", tooltipText = "Expand All", prefixIcon = "e-expand", id = "expandall" });
toolbarItems.Add(new { text = "Collapse All", tooltipText = "Collapse All", prefixIcon = "e-collapse", id = "collapseall", align = "Right" });
}
@Html.EJS().Grid("Grid")..
. . .
.Toolbar(toolbarItems).Render()
|
@{
List<object> toolbarItems = new List<object>();
. . .
toolbarItems.Add(new { text = "<", tooltipText = "Last Week", id = "lastweek", align = "Center" });
}
@Html.EJS().Grid("Grid").DataSource((IEnumerable<object>)ViewBag.dataSource).ToolbarClick("toolbarClick").Columns(col =>
{
. . .
}).AllowPaging().PageSettings(page => page.PageCount(2)).Toolbar(toolbarItems).Render()
<script>
function toolbarClick(args) {
if (args.item.id === 'lastweek') {
alert("ok");
}
if (args.item.id === "nextweek") {
alert("ok2");
}
}
</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.