Skip to content
This repository has been archived by the owner on Sep 11, 2021. It is now read-only.

Commit

Permalink
added number to table
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric Helin committed Feb 10, 2019
1 parent e85cb1a commit d6c8109
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
Expand Up @@ -14,6 +14,7 @@ class Table extends React.Component {
var trList = bucketListItems.map((bucketListItem, index) => {
return (
<tr key={bucketListItem.name}>
<td>{bucketListItem.number}</td>
<td>{bucketListItem.name}</td>
<td>{bucketListItem.dateCreated}</td>
<td>{bucketListItem.bucketListItemType}</td>
Expand All @@ -24,7 +25,8 @@ class Table extends React.Component {
});

return (<table border="1">
<thead>
<thead>
<th></th>
<th>Name</th>
<th>Date Created</th>
<th>Category</th>
Expand Down
9 changes: 8 additions & 1 deletion TgimbaNetCoreWebReactJs/ClientApp/src/store/Main.js
Expand Up @@ -39,12 +39,19 @@ export const actionCreators = {
const response = await fetch(url);
const bucketListItems = await response.json();

for (let i = 0; i < bucketListItems.length; i++) {
bucketListItems[i].number = i + 1;
}

dispatch({ type: ACTION_TYPE_LOAD, bucketListItems });
}
};

export const reducer = (state, action) => {
state = state || initialState;
state = state || initialState;

var utils = Object.create(utilsRef.Utilities);
var host = utils.GetHost();

if (action.type == ACTION_TYPE_MAIN_MENU) {
window.location = host + '/mainmenu';
Expand Down

0 comments on commit d6c8109

Please sign in to comment.