Skip to content

Commit 56d5cee

Browse files
Merge pull request #3280 from Syncfusion-Content/hotfix/hotfix-v26.2.4
DOCINFRA-2341_merged_using_automation
2 parents 95bb4d5 + 066c02e commit 56d5cee

File tree

176 files changed

+2811
-946
lines changed

Some content is hidden

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

176 files changed

+2811
-946
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
public IActionResult Index()
22
{
33
var Order = OrderDetails.GetAllRecords();
4-
ViewBag.DataSource = Order;
4+
ViewBag.dataSource = Order;
55
return View();
66
}

ej2-asp-core-mvc/code-snippet/grid/columns/primary/razor renamed to ej2-asp-core-mvc/code-snippet/grid/columns/auto-primary/razor

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
<script>
44
function dataBound() {
5-
var grid = document.getElementById('Auto').ej2_instances[0];
6-
var column = grid.columns[0];
7-
column.isPrimaryKey = 'true';
5+
document.getElementById('Auto').ej2_instances[0].columns[0].isPrimaryKey = 'true';
86
}
97
</script>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<ejs-grid id="Auto" dataSource="@ViewBag.dataSource" dataBound="dataBound">
2+
<e-grid-editSettings allowAdding="true" allowDeleting="true" allowEditing="true">
3+
</e-grid-editSettings>
4+
</ejs-grid>
5+
6+
<script>
7+
function dataBound() {
8+
document.getElementById('Auto').ej2_instances[0].columns[0].isPrimaryKey = 'true';
9+
}
10+
</script>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
@Html.EJS().Grid("Auto").DataSource((IEnumerable<object>)ViewBag.dataSource).Render()
1+
@Html.EJS().Grid("Auto").AllowPaging(true).DataSource((IEnumerable<object>)ViewBag.DataSource).Render()
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
<ejs-grid id="Grid" dataSource="@ViewBag.DataSource">
2-
1+
<ejs-grid id="Grid" allowPaging=true dataSource="@ViewBag.DataSource">
32
</ejs-grid>
Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
1-
@Html.EJS().Grid("Auto").DataSource((IEnumerable<object>)ViewBag.dataSource).DataBound("dataBound").Render()
2-
1+
@Html.EJS().Grid("Auto").DataSource((IEnumerable<object>)ViewBag.DataSource).DataBound("dataBound").Render()
32
<script>
43
function dataBound() {
5-
for (var i = 0; i < this.columns.length; i++) {
6-
this.columns[0].width = 120;
7-
if (this.columns[i].field === "OrderDate") {
8-
this.columns[i].type = "date";
4+
const grid = document.getElementById('Auto').ej2_instances[0];
5+
for (const cols of grid.columns) {
6+
if (cols.field === 'OrderID') {
7+
cols.width = 120;
98
}
10-
if (this.columns[i].type === "date") {
11-
this.columns[i].format = { type: "date", format: "dd/MM/yyyy" };
9+
if (cols.field === 'OrderDate') {
10+
cols.type = 'date';
11+
cols.format = 'yMd';
12+
}
13+
if (cols.field === 'Freight') {
14+
cols.format = 'P2';
1215
}
13-
this.columns[3].format = "P2";
1416
}
15-
this.refreshColumns();
17+
grid.refreshColumns();
1618
}
1719
</script>

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

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,19 @@
44

55
<script>
66
function dataBound() {
7-
for (var i = 0; i < this.columns.length; i++) {
8-
this.columns[0].width = 120;
9-
if (this.columns[i].field === "OrderDate") {
10-
this.columns[i].type = "date";
7+
const grid = document.getElementById('Auto').ej2_instances[0];
8+
for (const cols of grid.columns) {
9+
if (cols.field === 'OrderID') {
10+
cols.width = 120;
1111
}
12-
if (this.columns[i].type === "date") {
13-
this.columns[i].format = { type: "date", format: "dd/MM/yyyy" };
12+
if (cols.field === 'OrderDate') {
13+
cols.type = 'date';
14+
cols.format = 'yMd';
15+
}
16+
if (cols.field === 'Freight') {
17+
cols.format = 'P2';
1418
}
15-
this.columns[3].format = "P2";
1619
}
17-
this.refreshColumns();
20+
grid.refreshColumns();
1821
}
1922
</script>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
public IActionResult Index()
2+
{
3+
var ComplexData = ComplexData.GetAllRecords();
4+
ViewBag.DataSource = ComplexData;
5+
return View();
6+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
@{
2+
var valueAccess = "valueAccessFn";
3+
}
4+
5+
@Html.EJS().Grid("Grid").DataSource((IEnumerable<object>)ViewBag.DataSource).Height(350).Columns(col =>
6+
{
7+
col.Field("EmployeeID").HeaderText("Employee ID").TextAlign(Syncfusion.EJ2.Grids.TextAlign.Right).Width("120").Add();
8+
col.Field("Name").HeaderText("Full Name").ValueAccessor(valueAccess).Width("150").Add();
9+
col.Field("Title").HeaderText("Title").Width("150").Add();
10+
}).Render()
11+
12+
<script>
13+
function valueAccessFn(field, data) {
14+
return data[field].map((s) => { return s.LastName || s.FirstName; }).join(' ');
15+
}
16+
</script>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
@{
2+
var valueAccess = "valueAccessFn";
3+
}
4+
5+
<ejs-grid id="Grid" dataSource="@ViewBag.DataSource" height="350" >
6+
<e-grid-columns>
7+
<e-grid-column field="EmployeeID" headerText="Employee ID" width="150" ></e-grid-column>
8+
<e-grid-column field="Name" headerText="Full Name" width="150"></e-grid-column>
9+
<e-grid-column field="Title" headerText="Title" width="150"></e-grid-column>
10+
</e-grid-columns>
11+
</ejs-grid>
12+
13+
<script>
14+
function valueAccessFn(field, data) {
15+
return data[field].map((s) => { return s.LastName || s.FirstName; }).join(' ');
16+
}
17+
</script>

0 commit comments

Comments
 (0)