Skip to content

Commit bd949a9

Browse files
author
pipeline
committed
feature(EJ2-4017): Grid Resize samples have added.
1 parent 33c0d46 commit bd949a9

33 files changed

+93
-31
lines changed

src/grid/aggregatedefault-plnkr.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

src/grid/aggregategroup-plnkr.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

src/grid/batch-editing-plnkr.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

src/grid/column/autowrap-plnkr.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

src/grid/column/columnchooser-plnkr.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

src/grid/column/columnresizing-plnkr.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { Component, OnInit } from '@angular/core';
2+
import { ResizeService } from '@syncfusion/ej2-ng-grids';
3+
import { data } from '../data';
4+
5+
@Component({
6+
selector: 'ej2-grid-container',
7+
templateUrl: 'columnresizing.html',
8+
providers: [ResizeService]
9+
})
10+
export class ColumnResizingComponent implements OnInit {
11+
public data: Object[];
12+
ngOnInit(): void {
13+
this.data = data.slice(0, 60);
14+
}
15+
}

src/grid/column/columnresizing.html

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<div class="control-section">
2+
<ej-grid [dataSource]='data' allowResizing= 'true' height= '400'>
3+
<e-columns>
4+
<e-column field='OrderID' headerText='Order ID' minWidth='120' width='200' maxWidth='300' textAlign="right"></e-column>
5+
<e-column field='CustomerName' headerText='Customer Name' width='200'></e-column>
6+
<e-column field='OrderDate' headerText='Order Date' width='200' format="yMd" textAlign="right"></e-column>
7+
<e-column field='Freight' headerText='Freight' width='150' format='C2' textAlign="right"></e-column>
8+
<e-column field='ShipName' headerText='Ship Name' width='300'></e-column>
9+
<e-column field='ShippedDate' headerText='Shipped Date' allowResizing ='false' width='200' format="yMd" textAlign="right"></e-column>
10+
<e-column field='ShipCountry' headerText='Ship Country' width='200'></e-column>
11+
<e-column field='ShipCity' headerText='Ship City' width='200'></e-column>
12+
</e-columns>
13+
</ej-grid>
14+
<div id="description">
15+
<p>The Grid columns can be resized by clicking and dragging at the right corner of columns header. To enable column resize behavior, set <code><a target="_blank" class="code"
16+
href="http://ej2.syncfusion.com/angular/documentation/grid/api-gridComponent.html#allowresizing-boolean">allowResizing
17+
</a></code> property as true. You can also prevent to resize the particular column by setting
18+
<code><a target="_blank" class="code"
19+
href="http://ej2.syncfusion.com/angular/documentation/grid/api-columnDirective.html#allowresizing-any">columns->allowResizing
20+
</a></code> as false in columns definition.
21+
22+
And, when double click at the right corner of column header, the respective column width will auto adjusted to its fit by <code><a target="_blank" class="code"
23+
href="http://ej2.syncfusion.com/angular/documentation/grid/api-gridComponent.html#autofitcolumns">autoFitColumns
24+
</a></code> method.
25+
26+
</p>
27+
<br/>
28+
29+
<p>
30+
In this demo, allowResizing feature have enabled through by setting the <code> allowResizing property </code> to true and <b>Order ID</b> column can be resized
31+
between the range of <code><a target="_blank" class="code"
32+
href="http://ej2.syncfusion.com/angular/documentation/grid/api-columnDirective.html#minwidth-any">minWidth (120px)
33+
</a></code> and <code><a target="_blank" class="code"
34+
href="http://ej2.syncfusion.com/angular/documentation/grid/api-columnDirective.html#maxwidth-any">maxWidth (300px).
35+
</a></code> Also, column resizing has disabled in <b>Shipped Date</b> column.
36+
</p>
37+
38+
<p style="font-weight: 500">Injecting Module</p>
39+
<p>
40+
Grid component features are segregated into individual feature-wise modules. To use Resize feature, we need to inject
41+
<code>ResizeService</code> into the <code>@NgModule.providers</code> section.
42+
</p>
43+
</div>
44+
</div>

src/grid/column/reorder-plnkr.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

src/grid/column/showhide-plnkr.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)