You may download the starter project for this lesson by clicking here. (You can also download the final project by clicking here.)
After downloading the project, navigate to the directory and run the commands below:
Execute the npm install command to install lite server (web server) dependencies, and execute the npm start command to run the React application. If everything is correct, you will find a React application running in the browser as shown below:
Step 1 Initialize Initial State
To initialize the grid, you may want to set values for various properties of grid such as datasource, width, row styles, etc. You can set these grid properties in the getInitialState() function. Open the index.js file and modify the getInitialState() function with the code below:
You are setting dataSource, width, and alternateRowStyles properties with the properties of the object returned from the getInitialState() function.
Step 3 Configure Columns of the Grid
Navigate to the application to find that a grid has been configured with the columns.