This repository was archived by the owner on Jul 30, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathlocal-binding.tsx
More file actions
48 lines (45 loc) · 2.88 KB
/
local-binding.tsx
File metadata and controls
48 lines (45 loc) · 2.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import * as ReactDOM from 'react-dom';
import * as React from 'react';
import { GridComponent, ColumnsDirective, ColumnDirective, Page, Inject } from '@syncfusion/ej2-react-grids';
import { data } from './data';
import { SampleBase } from '../common/sample-base';
export class Localbinding extends SampleBase<{}, {}> {
render() {
return (
<div className='control-pane'>
<div className='control-section'>
<GridComponent dataSource={data} allowPaging={true} pageSettings={{ pageCount: 5 }}>
<ColumnsDirective>
<ColumnDirective field='OrderID' headerText='Order ID' width='120' textAlign='Right'></ColumnDirective>
<ColumnDirective field='CustomerName' headerText='Customer Name' width='150'></ColumnDirective>
<ColumnDirective field='OrderDate' headerText='Order Date' width='130' format='yMd' textAlign='Right' />
<ColumnDirective field='Freight' headerText='Freight' width='120' format='C2' textAlign='Right' />
<ColumnDirective field='ShippedDate' headerText='Shipped Date' width='130' format='yMd' textAlign='Right'></ColumnDirective>
<ColumnDirective field='ShipCountry' headerText='Ship Country' width='150'></ColumnDirective>
</ColumnsDirective>
<Inject services={[Page]} />
</GridComponent>
</div>
<div id="action-description">
<p>This sample demonstrates the way of data binding Grid component with JavaScript object array (local data source).
</p>
</div>
<div id='description'>
<p>
The Grid supports data binding. The <code><a target='_blank' className='code'
href='http://ej2.syncfusion.com/react/documentation/grid/api-grid.html#datasource-object---datamanager'>
dataSource</a></code> property can be assigned either with the array of JavaScript objects or instance of <code><a target='_blank' className='code'
href='http://ej2.syncfusion.com/react/documentation/grid/api-grid.html#datasource-object---datamanager'>
datamanager</a></code>.
</p>
<p>
Grid component features are segregated into individual feature-wise modules. </p>
<p>
More information on the dataBinding feature configuration can be found in this
<a target='_blank' href='http://ej2.syncfusion.com/react/documentation/grid/api-grid.html#datasource-object---datamanager'> documentation section</a>.
</p>
</div>
</div>
)
}
}