Posted 26 November 2017, 6:25 pm EST
Hi Jennifer,
Follow these steps to install Wijmo using create-react-app cli tool.
npm install -g create-react-app
create-react-app my-app
cd my-app
npm install "http://prerelease.componentone.com/wijmo5/npm-images/C1Wijmo-Enterprise-Eval-AMD-5.20173.381.tgz"
Add this css to public/index.html
<link href="http://cdn.wijmo.com/5.20173.381/styles/wijmo.min.css" rel="stylesheet" />
Go to src/App.js
Add the following import:
import * as wjGrid from 'wijmo/wijmo.react.grid';
Use the control in your app:
class App extends Component {
data = [
{ country:"Japan", date: new Date(2017,1,1), sales: 0 },
{ country:"USA", date: new Date(2017,1,1), sales: 0 },
{ country:"UK", date: new Date(2017,1,1), sales: 0 },
{ country:"China", date: new Date(2017,1,1), sales: 0 }
]
render() {
return (
<div className="App">
<header className="App-header">
<img src={logo} className="App-logo" alt="logo" />
<h1 className="App-title">Welcome to React</h1>
</header>
<p className="App-intro">
To get started, edit <code>src/App.js</code> and save to reload.
</p>
<wjGrid.FlexGrid
autoGenerateColumns={false}
columns={[
{ header: 'Country', binding: 'country', width: '*' },
{ header: 'Date', binding: 'date' },
{ header: 'Sales', binding: 'sales', format: 'c2' }
]}
itemsSource={this.data}
style={{ height: '250px', width: '500px' }}
/>
</div>
);
}
}
Find the attachment.
Run npm install in case of any error.
~nilay
my-new-app.zip