Skip to content

Commit e0f3df3

Browse files
Merge branch 'hotfix/hotfix-v28.1.33' into 929925-dialog
2 parents 09c2536 + 2ffe63e commit e0f3df3

File tree

89 files changed

+1887
-709
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+1887
-709
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
public IActionResult Index()
2+
{
3+
ViewBag.DataSource = OrderDetails.GetAllRecords();
4+
return View();
5+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<ejs-grid id="grid" dataSource="@ViewBag.DataSource" allowPaging="true" height='348px'>
2+
<e-grid-aggregates>
3+
<e-grid-aggregate>
4+
<e-aggregate-columns>
5+
<e-aggregate-column field="Freight" types="@(new List<string>(){"Sum", "Max", "Min"})" format="C2" footerTemplate="Maxi:${Max}, Sum:${Sum}, Min:${Min}"></e-aggregate-column> </e-aggregate-columns>
6+
</e-grid-aggregate>
7+
</e-grid-aggregates>
8+
<e-grid-columns>
9+
<e-grid-column field="OrderID" headerText="Order ID" width="150" textAlign="Right"></e-grid-column>
10+
<e-grid-column field="CustomerID" headerText="Customer Name" width="150"></e-grid-column>
11+
<e-grid-column field="Freight" headerText="Freight" textAlign="Right" format="C2" width="160"></e-grid-column>
12+
<e-grid-column field="ShipCountry" headerText="Ship Country" width="140"></e-grid-column>
13+
</e-grid-columns>
14+
</ejs-grid>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
public IActionResult Index()
2+
{
3+
ViewBag.DataSource = ComplexData.GetAllRecords();
4+
return View();
5+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
@Html.EJS().Grid("grid").DataSource((IEnumerable<object>)ViewBag.DataSource).Height("350px").Columns(col =>
2+
{
3+
col.Field("EmployeeID").HeaderText("Employee ID").TextAlign(Syncfusion.EJ2.Grids.TextAlign.Right).Width("120").Add();
4+
col.Field("Names.0.FirstName").HeaderText("First Name").Width("120").Add();
5+
col.Field("Names.0.LastName").HeaderText("Last Name").Width("120").Add();
6+
col.Field("Title").HeaderText("Title").Width("150").Add();
7+
}).Render()
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<ejs-grid id="grid" dataSource="@ViewBag.DataSource" height="315px" >
2+
<e-grid-columns>
3+
<e-grid-column field="EmployeeID" headerText="Employee ID" width="120" textAlign="Right"></e-grid-column>
4+
<e-grid-column field="Names.0.FirstName" headerText="Last Name" width="120"></e-grid-column>
5+
<e-grid-column field="Names.0.LastName" headerText="Last Name" width="120"></e-grid-column>
6+
<e-grid-column field="Title" headerText="Title" width="150"></e-grid-column>
7+
</e-grid-columns>
8+
</ejs-grid>
Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
public IActionResult DefaultExporting()
22
{
3-
var order = OrdersDetails.GetAllRecords();
4-
ViewBag.DataSource = order;
5-
6-
var emp = EmployeeView.GetAllRecords();
7-
ViewBag.foreign = emp;
3+
ViewBag.DataSource = OrdersDetails.GetAllRecords();
4+
ViewBag.EmployeeData = EmployeeView.GetAllRecords();
85
return View();
96
}
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
@Html.EJS().Grid("ForeignKey").DataSource((IEnumerable<object>)ViewBag.DataSource).Columns(col =>
1+
@Html.EJS().Grid("grid").DataSource((IEnumerable<object>)ViewBag.DataSource).Height("348px").Columns(col =>
22
{
33
col.Field("OrderID").HeaderText("Order ID").Width("120").TextAlign(Syncfusion.EJ2.Grids.TextAlign.Right).Add();
4-
col.Field("Employee.EmployeeID").ForeignKeyField("EmployeeID").ForeignKeyValue("FirstName").DataSource((IEnumerable<object>)ViewBag.foreign).HeaderText("Employee Name").Width("150").Add();
4+
col.Field("Employee.EmployeeID").ForeignKeyField("EmployeeID").ForeignKeyValue("FirstName").DataSource((IEnumerable<object>)ViewBag.EmployeeData).HeaderText("Employee Name").Width("150").Add();
55
col.Field("Freight").HeaderText("Freight").Width("120").Format("C2").TextAlign(Syncfusion.EJ2.Grids.TextAlign.Right).Add();
66
col.Field("ShipName").HeaderText("Ship Name").Width("150").Add();
7-
87
}).Render()

ej2-asp-core-mvc/code-snippet/grid/columns/foreignkey/tagHelper

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
<ejs-grid id="Grid" dataSource="@ViewBag.DataSource">
1+
<ejs-grid id="grid" dataSource="@ViewBag.DataSource" height="348px">
22
<e-grid-columns>
33
<e-grid-column field="OrderID" headerText="Order ID" isPrimaryKey="true" textAlign="Right" width="120"></e-grid-column>
4-
<e-grid-column field="Employee.EmployeeID" foreignKeyField= "EmployeeID" headerText="Employee Name" foreignKeyValue="FirstName" dataSource="ViewBag.foreign" width="150"></e-grid-column>
4+
<e-grid-column field="Employee.EmployeeID" foreignKeyField= "EmployeeID" headerText="Employee Name" foreignKeyValue="FirstName" dataSource="ViewBag.EmployeeData" width="150"></e-grid-column>
55
<e-grid-column field="Freight" headerText="Freight" textAlign="Right" format="C2" width="120"></e-grid-column>
66
<e-grid-column field="ShipName" headerText="Ship Name" width="150"></e-grid-column>
77
</e-grid-columns>

ej2-asp-core-mvc/code-snippet/grid/edit/columnvalid/columnvalid.cs

Lines changed: 0 additions & 8 deletions
This file was deleted.

ej2-asp-core-mvc/code-snippet/grid/edit/columnvalid/razor

Lines changed: 0 additions & 9 deletions
This file was deleted.

ej2-asp-core-mvc/code-snippet/grid/edit/columnvalid/tagHelper

Lines changed: 0 additions & 9 deletions
This file was deleted.
Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
public IActionResult Index()
2-
{
3-
var orders= OrderDetails.GetAllRecords();
4-
ViewBag.DataSource = orders;
5-
return View();
6-
}
1+
public IActionResult Index()
2+
{
3+
ViewBag.DataSource = OrderDetails.GetAllRecords();
4+
return View();
5+
}
76

87

ej2-asp-core-mvc/code-snippet/grid/edit/commandcolumn/razor

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,11 @@
66
commands.Add(new { type = "Cancel", buttonOption = new { iconCss = "e-icons e-cancel-icon", cssClass = "e-flat" } });
77
}
88

9-
@Html.EJS().Grid("CommandColumn").DataSource((IEnumerable<object>)ViewBag.DataSource).Columns(col =>
9+
@Html.EJS().Grid("grid").DataSource((IEnumerable<object>)ViewBag.DataSource).Height("348px").Columns(col =>
1010
{
1111
col.Field("OrderID").HeaderText("Order ID").IsPrimaryKey(true).Width("120").TextAlign(Syncfusion.EJ2.Grids.TextAlign.Right).Add();
1212
col.Field("CustomerID").HeaderText("Customer Name").Width("150").Add();
1313
col.Field("Freight").HeaderText("Freight").Width("120").EditType("numericedit").Format("C2").TextAlign(Syncfusion.EJ2.Grids.TextAlign.Right).Add();
14-
col.Field("ShipName").HeaderText("Ship Name").Width("150").Add();
1514
col.Field("ShipCountry").HeaderText("Ship Country").EditType("dropdownedit").Width("150").Add();
16-
col.HeaderText("Manage Records").Width("160").Commands(commands).Add();
17-
18-
}).AllowPaging().EditSettings(edit => { edit.AllowAdding(true).AllowEditing(true).AllowDeleting(true); }).Render()
15+
col.HeaderText("Commands").Width("160").Commands(commands).Add();
16+
}).EditSettings(edit => { edit.AllowAdding(true).AllowEditing(true).AllowDeleting(true); }).Render()

ej2-asp-core-mvc/code-snippet/grid/edit/commandcolumn/tagHelper

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77
commands.Add(new { type = "Cancel", buttonOption = new { iconCss = "e-icons e-cancel-icon", cssClass = "e-flat" } });
88
}
99

10-
<ejs-grid id="Grid" dataSource="@ViewBag.DataSource" height="310">
10+
<ejs-grid id="grid" dataSource="@ViewBag.DataSource" height="400px">
1111
<e-grid-editSettings allowDeleting="true" allowEditing="true" mode="Normal"></e-grid-editSettings>
1212
<e-grid-columns>
1313
<e-grid-column field="OrderID" headerText="Order ID" isPrimaryKey="true" textAlign="Right" width="100"></e-grid-column>
14-
<e-grid-column field="CustomerID" headerText="Customer ID" type="string" width="120"></e-grid-column>
14+
<e-grid-column field="CustomerID" headerText="Customer Name" type="string" width="120"></e-grid-column>
1515
<e-grid-column field="Freight" headerText="Freight" textAlign="Right" format="C2" editType="numericedit" width="120"></e-grid-column>
16-
<e-grid-column field="ShipCountry" headerText="Ship Country" width="150"></e-grid-column>
17-
<e-grid-column headerText="Manage Records" width="120" command=commands>
16+
<e-grid-column field="ShipCountry" headerText="Ship Country" editType="dropdownedit" width="150"></e-grid-column>
17+
<e-grid-column headerText="Commands" width="120" command="commands">
1818
</e-grid-column>
1919
</e-grid-columns>
2020
</ejs-grid>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
public IActionResult Index()
2+
{
3+
ViewBag.DataSource = OrdersDetails.GetAllRecords();
4+
return View();
5+
}
6+
7+
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
@{
2+
ViewBag.DropDownData = new List<object>
3+
{
4+
new { Country = "United States"},
5+
new { Country = "Australia" },
6+
new { Country = "India" },
7+
new { Country = "Germany" },
8+
new { Country = "France" },
9+
new { Country = "Brazil" }
10+
};
11+
var DropDownList = new Syncfusion.EJ2.DropDowns.DropDownList() { DataSource = ViewBag.DropDownData, Query = "new ej.data.Query()", AllowFiltering = true, Fields = new Syncfusion.EJ2.DropDowns.DropDownListFieldSettings() { Value = "Country", Text = "Country" } };
12+
}
13+
14+
@Html.EJS().Grid("grid").DataSource((IEnumerable<object>)ViewBag.DataSource).Height("348px").Columns(col =>
15+
{
16+
col.Field("OrderID").HeaderText("Order ID").IsPrimaryKey(true).Width("120").TextAlign(Syncfusion.EJ2.Grids.TextAlign.Right).Add();
17+
col.Field("CustomerID").HeaderText("Customer ID").Width("150").Add();
18+
col.Field("Freight").HeaderText("Freight").Width("120").Format("C2").TextAlign(Syncfusion.EJ2.Grids.TextAlign.Right).Add();
19+
col.Field("ShipName").HeaderText("Ship Name").Width("150").Add();
20+
col.Field("ShipCountry").HeaderText("Ship Country").Width("150").EditType("dropdownedit").Edit(new { @params = DropDownList }).Add();
21+
}).AllowPaging().EditSettings(edit => { edit.AllowAdding(true).AllowEditing(true).AllowDeleting(true).Mode(Syncfusion.EJ2.Grids.EditMode.Normal); }).Toolbar(new List<string>() { "Add", "Edit", "Delete", "Update", "Cancel" }).Render()
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
@{
2+
ViewBag.DropDownData = new List<object>
3+
{
4+
new { Country = "United States"},
5+
new { Country = "Australia" },
6+
new { Country = "India" },
7+
new { Country = "Germany" },
8+
new { Country = "France" },
9+
new { Country = "Brazil" }
10+
};
11+
var DropDownList = new Syncfusion.EJ2.DropDowns.DropDownList() { DataSource = ViewBag.DropDownData, Query = "new ej.data.Query()", AllowFiltering = true, Fields = new Syncfusion.EJ2.DropDowns.DropDownListFieldSettings() { Value = "Country", Text = "Country" } };
12+
}
13+
14+
<ejs-grid id="grid" dataSource="@ViewBag.DataSource" height="348px" toolbar="@(new List<string>() { "Add", "Edit", "Delete", "Cancel", "Update" })">
15+
<e-grid-editSettings allowAdding="true" allowDeleting="true" allowEditing="true" mode="Normal"></e-grid-editSettings>
16+
<e-grid-columns>
17+
<e-grid-column field="OrderID" headerText="Order ID" isPrimaryKey="true" textAlign="Right" width="100"></e-grid-column>
18+
<e-grid-column field="CustomerID" headerText="Customer ID" type="string" width="120"></e-grid-column>
19+
<e-grid-column field="Freight" headerText="Freight" textAlign="Right" format="C2" editType="numericedit" width="120"></e-grid-column>
20+
<e-grid-column field="ShipCountry" headerText="Ship Country" width="150" editType="dropdownedit" edit="new {@params = DropDownList }"></e-grid-column>
21+
</e-grid-columns>
22+
</ejs-grid>
Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
public IActionResult Index()
2-
{
3-
var orders = OrdersDetails.GetAllRecords();
4-
ViewBag.DataSource = orders;
5-
return View();
6-
}
1+
public IActionResult Index()
2+
{
3+
ViewBag.DataSource = OrdersDetails.GetAllRecords();
4+
return View();
5+
}
76

87

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,38 @@
11
@{
22
List<object> commands = new List<object>();
3-
commands.Add(new { type = "userstatus", buttonOption = new { content = "Details", cssClass = "e-flat" } });
3+
commands.Add(new { buttonOption = new { content = "Details", cssClass = "e-flat" } });
44
}
55

6-
@Html.EJS().Grid("CustomCommand").DataSource((IEnumerable<object>)ViewBag.DataSource).Columns(col =>
6+
<div id="dialog" ></div>
7+
@Html.EJS().Grid("grid").DataSource((IEnumerable<object>)ViewBag.DataSource).Height("348px").Columns(col =>
78
{
89
col.Field("OrderID").HeaderText("Order ID").IsPrimaryKey(true).Width("120").TextAlign(Syncfusion.EJ2.Grids.TextAlign.Right).Add();
910
col.Field("CustomerID").HeaderText("Customer Name").Width("150").Add();
1011
col.Field("Freight").HeaderText("Freight").Width("120").EditType("numericedit").Format("C2").TextAlign(Syncfusion.EJ2.Grids.TextAlign.Right).Add();
11-
col.Field("ShipName").HeaderText("Ship Name").Width("150").Add();
1212
col.Field("ShipCountry").HeaderText("Ship Country").EditType("dropdownedit").Width("150").Add();
1313
col.HeaderText("Commands").Width("160").Commands(commands).Add();
14-
15-
}).AllowPaging().CommandClick("commandClick").EditSettings(edit => { edit.AllowAdding(true).AllowEditing(true).AllowDeleting(true); }).Render()
16-
14+
}).CommandClick("commandClick").Render();
1715
<script>
16+
var dialogVisible = false;
17+
var dialog = new ej.popups.Dialog({
18+
header: "Row Information",
19+
content: "dialogContent",
20+
showCloseIcon: "true",
21+
width: "400px",
22+
position: { X: 570, Y: 220 },
23+
visible: dialogVisible,
24+
close: dialogClose,
25+
});
26+
dialog.appendTo('#dialog');
1827
function commandClick(args) {
19-
alert(JSON.stringify(args.rowData)); // display row data
20-
}
28+
var dialog = document.getElementById('dialog').ej2_instances[0];
29+
dialog.visible = true;
30+
dialog.content =
31+
`<p><b>ShipName:</b> ${args.rowData.ShipName}</p>
32+
<p><b>ShipPostalCode:</b> ${args.rowData.ShipPostalCode}</p>
33+
<p><b>ShipAddress:</b> ${args.rowData.ShipAddress}</p>`
34+
}
35+
function dialogClose() {
36+
dialogVisible = false;
2137
}
2238
</script>
Lines changed: 30 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,38 @@
11
@{
22
List<object> commands = new List<object>();
3-
commands.Add(new { type = "userstatus", buttonOption = new { content = "Details", cssClass = "e-flat e-details" } }); // custom
3+
commands.Add(new { buttonOption = new { content = "Details", cssClass = "e-flat" } });
44
}
5-
6-
<div class="control-section">
7-
<ejs-grid id="Grid" dataSource="@ViewBag.DataSource" commandClick="commandClick" allowPaging="true">
8-
<e-grid-editSettings allowAdding="false" allowDeleting="false" allowEditing="true"></e-grid-editSettings>
5+
<div id="dialog" ></div>
6+
<ejs-grid id="grid" dataSource="@ViewBag.DataSource" height="400px" commandClick="commandClick">
97
<e-grid-columns>
10-
<e-grid-column field="OrderID" headerText="Order ID" validationRules="@(new { required=true})" isPrimaryKey="true" textAlign="Right" width="100"></e-grid-column>
11-
<e-grid-column field="Verified" headerText="Verified" editType="booleanedit" displayAsCheckBox="true" textAlign="Center" type="boolean" width="100"></e-grid-column>
12-
<e-grid-column headerText="Manage Records" width="150" commands="commands"></e-grid-column>
8+
<e-grid-column field="OrderID" headerText="Order ID" isPrimaryKey="true" textAlign="Right" width="100"></e-grid-column>
9+
<e-grid-column field="CustomerID" headerText="Customer ID" type="string" width="120"></e-grid-column>
10+
<e-grid-column field="Freight" headerText="Freight" textAlign="Right" format="C2" editType="numericedit" width="120"></e-grid-column>
11+
<e-grid-column field="ShipCountry" headerText="Ship Country" width="150"></e-grid-column>
12+
<e-grid-column headerText="Commands" width="150" commands="commands"></e-grid-column>
1313
</e-grid-columns>
1414
</ejs-grid>
15-
</div>
16-
1715
<script>
18-
function commandClick(args) {
19-
alert(JSON.stringify(args.rowData)); // display row data
20-
}
16+
var dialogVisible = false;
17+
var dialog = new ej.popups.Dialog({
18+
header: "Row Information",
19+
content: "dialogContent",
20+
showCloseIcon: "true",
21+
width: "400px",
22+
position: { X: 570, Y: 220 },
23+
visible: dialogVisible,
24+
close: dialogClose,
25+
});
26+
dialog.appendTo('#dialog');
27+
function commandClick(args) {
28+
var dialog = document.getElementById('dialog').ej2_instances[0];
29+
dialog.visible = true;
30+
dialog.content =
31+
`<p><b>ShipName:</b> ${args.rowData.ShipName}</p>
32+
<p><b>ShipPostalCode:</b> ${args.rowData.ShipPostalCode}</p>
33+
<p><b>ShipAddress:</b> ${args.rowData.ShipAddress}</p>`
34+
}
35+
function dialogClose() {
36+
dialogVisible = false;
37+
}
2138
</script>

ej2-asp-core-mvc/code-snippet/grid/edit/customvalidation/razor

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)