Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
141262 | Nov 30,2018 05:00 PM UTC | Dec 3,2018 10:27 AM UTC | ASP.NET MVC | 1 |
![]() |
Tags: Grid |
@(Html.EJ().Grid<object>("Grid")
………………….
.ToolbarSettings(toolbar =>
{
toolbar.ShowToolbar().ToolbarItems(items =>
{
………..
}).CustomToolbarItems(new List<object>() { new Syncfusion.JavaScript.Models.CustomToolbarItem() { TemplateID = "#Details" } });
}).ClientSideEvents(eve => eve.Create("create").ToolbarClick("ToolBarClick"))
.Columns(col =>
{
…………..
})
)
<script>
function ToolBarClick(args) {
if (args.itemName == "Details") {
$.ajax({
type: "POST",
url: "/Grid/GetData",
datatype: "json",
contentType: "application/json; charset=utf-8",
success: function (data) {
var gridObj = $("#Grid").ejGrid('instance'); // create grid instance using grid ID
gridObj.dataSource(data);
$("#showopen").html('Updated'); // Use button ID here.
alert("data source refreshed and button text changed") },
});
}
}
</script>
<script type="text/x-jsrender" id="Details">
<button class="btn btn-info" type="button" id="showopen">
Show Open
</button>
</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.