Skip to content

Commit faeb25a

Browse files
committed
fix: use only grid with defined columns
1 parent 8cbb079 commit faeb25a

File tree

2 files changed

+35
-4
lines changed
  • packages/cli/templates/react

2 files changed

+35
-4
lines changed

packages/cli/templates/react/igr-es6/grid/basic/files/src/views/__path__/index.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,14 @@ export default class $(ClassName) extends Component {
3030
<div className={style.grid}>
3131
<IgrDataGrid
3232
height="100%"
33-
width="100%"
34-
autoGenerateColumns="true"
35-
dataSource={this.data} />
33+
autoGenerateColumns="false"
34+
dataSource={this.data}>
35+
<IgrNumericColumn field="ProductID" headerText="Product ID" />
36+
<IgrTextColumn field="ProductName" headerText="Product Name" />
37+
<IgrTextColumn field="QuantityPerUnit" headerText="Quantity Per Unit" />
38+
<IgrNumericColumn field="UnitsInStock" headerText="Units In Stock" />
39+
<IgrDateTimeColumn field="OrderDate" headerText="Order Date" />
40+
</IgrDataGrid>
3641
</div>
3742
</div>
3843
</div>

packages/cli/templates/react/igr-ts/grid/basic/files/src/app/__path__/__filePrefix__.tsx

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,33 @@ export default function $(ClassName)() {
2121
</div>
2222
<div className={style.container}>
2323
<div className={style.grid}>
24-
<IgrGrid autoGenerate={true} data={data} />
24+
<IgrGrid autoGenerate={false} data={data}>
25+
<IgrColumn
26+
field="ProductID"
27+
header="Product ID"
28+
dataType="number">
29+
</IgrColumn>
30+
<IgrColumn
31+
field="ProductName"
32+
header="Product Name"
33+
dataType="string">
34+
</IgrColumn>
35+
<IgrColumn
36+
field="QuantityPerUnit"
37+
header="Quantity Per Unit"
38+
dataType="string">
39+
</IgrColumn>
40+
<IgrColumn
41+
field="UnitsInStock"
42+
header="Units In Stock"
43+
dataType="number">
44+
</IgrColumn>
45+
<IgrColumn
46+
field="OrderDate"
47+
header="Order Date"
48+
dataType="date">
49+
</IgrColumn>
50+
</IgrGrid>
2551
</div>
2652
</div>
2753
</div>

0 commit comments

Comments
 (0)