BoldSignA modern eSignature application with affordable pricing. Sign up today for unlimited document usage!
@(Html.EJ().Grid<MVCGrid.OrdersView>("FlatGrid") .Datasource((IEnumerable<object>)ViewBag.datasource) .EnableRowHover(false) .AllowSelection(false) .Columns(col => { col.Field("EmployeeID").HeaderText("Employee ID").IsPrimaryKey(true).TextAlign(TextAlign.Right).Width(100).Add(); col.HeaderText("Employee Details").Commands(command => { command.Type("detail") .ButtonOptions(new Syncfusion.JavaScript.Models.ButtonProperties() { Text = "Details", Width = "100px", Click = "onClick" }).Add(); }) .IsUnbound(true) .TextAlign(TextAlign.Center) .Width(150) .Add(); }) ) @(Html.EJ().Dialog("commanddialog") .Width(450) .Title("Details of employee") .ShowOnInit(false) .EnableResize(false) .Target("#FlatGrid") ) } <div id="Grid"></div> <script type="text/javascript"> function onClick(args) { $("#Grid").data("ejGrid") !== undefined && $("#Grid").ejGrid("destroy"); var grid = $("#FlatGrid").ejGrid("instance"); var index = this.element.closest("tr").index(); var record = grid.getCurrentViewData()[index]; $("#Grid").ejGrid({ dataSource: [record], columns: [ { field: "FirstName", headerText: "First Name", width: 110 }, { field: "LastName", headerText: "Last Name", width: 110 }, { field: "HireDate", headerText: "Hire Date", format:"{0:MM/dd/yyyy}", width: 110 }, { field: "Country", headerText: "Country", width: 110 }] });
$("#commanddialog").append($("#Grid")) .ejDialog("option", { position: { X: this.element.offset().left - 455, Y: this.element.offset().top } }) .ejDialog("open"); } |
@(Html.EJ().Grid<MVCGrid.OrdersView>("FlatGrid") .Datasource((IEnumerable<object>)ViewBag.datasource) .EnableRowHover(false) .AllowSelection(false) .Columns(col => { col.Field("EmployeeID").HeaderText("Employee ID").IsPrimaryKey(true).TextAlign(TextAlign.Right).Width(100).Add(); col.HeaderText("Employee Details").Commands(command => { command.Type("detail") .ButtonOptions(new Syncfusion.JavaScript.Models.ButtonProperties() { Text = "Details", Width = "100px", Click = "onClick" }).Add(); }) .IsUnbound(true) .TextAlign(TextAlign.Center) .Width(150) .Add(); }) ) @(Html.EJ().Dialog("commanddialog") .Width(450) .Title("Details of Task") .ShowOnInit(false) .EnableResize(false) .Target("#FlatGrid") ) <div id="Grid"></div> <script type="text/javascript"> var data = [{ "Id": 190, "TaskId": 190, "TaskNo": "SH_M0NF8URW_1", "State": "Open", "Name": null }, { "Id": 201, "TaskId": 201, "TaskNo": "SH_M0NF8URW_12", "State": "Open", "Name": null }, { "Id": 202, "TaskId": 202, "TaskNo": "SH_M0NF8URW_13", "State": "Open", "Name": null }] function onClick(args) { $("#Grid").data("ejGrid") !== undefined && $("#Grid").ejGrid("destroy"); $("#Grid").ejGrid({ dataSource: data,// Bound the JSON data }); $("#commanddialog").append($("#Grid")) .ejDialog("option", { position: { X: this.element.offset().left - 455, Y: this.element.offset().top } }) .ejDialog("open"); } </script> |