JavaScript How to push props to a new page on button click?

I currently have a table and each cell has a button. Upon clicking the button, based on that particular day (Monday or Tuesday), class (class 1 or class 2), and name (Kev or Josh), how can I push an object related to that particular button in the table to a new page? Using, ReactJS + React Router + Redux, what would be the correct approach to this?

And when once navigated to the new page, the new page would then populate a table with the class information from the object passed in, related to button cell clicked.

Code:

http://jsfiddle.net/k7wbzc4j/16/

<table className="test-table">
  <thead>
    <tr>
      <th>List</th>
      <th colSpan="2">Monday</th>
      <th colSpan="2">Tuesday</th>
    </tr>
    <tr>
      <th>Names</th>
      <th>Class 1</th><th>Class 2</th>
      <th>Class 1</th><th>Class 2</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Kev</td>
      <td><button>abc</button></td><td><button>def</button></td>
      <td><button>ghi</button></td><td><button>jkl</button></td>
    </tr>
    <tr>
      <td>Josh</td>
      <td><button>mno</button></td><td><button>pqr</button></td>
      <td><button>stu</button></td><td><button>vwx</button></td>
    </tr>
  </tbody>
</table>

Will accept and upvote answer. Thank you in advance

EDIT

Should the table rows data be structured like so and reference the object based on ID like the following? If so how can I locate that particular id object based on the cell location (with day, name, and class number taken into account)?

list: [
  {
    name: Kev
      monday: {
        class1: {
          id: 0,
          classTitle: abc,
          number: class1,
          info: {
            time: 1,
            classSize: 2,
          }
        },
        class 2: {
          id: 1,
          classTitle: def,
          number: class2,
          info: {
            time: 1,
            classSize: 2,
          }
        }
      },
      tuesday: {
        class1: {
          id: 2,
          classTitle: ghi,
          number: class1,
          info: {
            time: 1,
            classSize: 2,
          }
        },
        class 2: {
          id: 3,
          classTitle: jkl,
          number: class2,
          info: {
            time: 1,
            classSize: 2,
          }
        }
      },
  },

  {
    name: Josh, 
      monday: {
        class1: {
          id: 4,
          classTitle: mno,
          number: class1,
          info: {
            time: 1,
            classSize: 2,
          }
        },
        class2: {
          id: 5,
          classTitle: pqr,
          number: class2,
          info: {
            time: 1,
            classSize: 2,
          }
        }
      },
      tuesday: {
        class1: {
          id: 6,
          classTitle: stu,
          number: class1,
          info: {
            time: 1,
            classSize: 2,
          }
        },
        class2: {
          id: 7,
          classTitle: vwx,
          number: class2,
          info: {
            time: 1,
            classSize: 2,
          }
        }
      },
    }
  }
]
Answer:1

your JSFiddle doesn't use react-router or react-redux so nobody will be able to point to one particular place of your code and tell you what exactly to do differently.

that said, one typical way to do this is to use regular links (or react-router Links) inside your table instead of Buttons, where each link includes an id parameter:

/newpage/<id>

. You then declare a react-router route which maps route to component:

<Route path="newpage" component={NewPage}>
  <Route path=":classInfoId" component={NewPage} />
</Route>

. When the user visits, for example, /newpage/123 in your app then the NewPage component will be rendered. React-router will inject a params prop that looks like:

{classInfoId: 123}

. You then fetch from your Redux store the class info object with an id of 123, and display it as you wish.

Answer:2

Lets say I had a HTML5/JS based application that is wrapped in cordova phone gap. Can I have it startup and download additional html5/js files? Basically the app would work with the base files, but ...

Lets say I had a HTML5/JS based application that is wrapped in cordova phone gap. Can I have it startup and download additional html5/js files? Basically the app would work with the base files, but ...

I have a form with multiple TextBoxes, Textarea and Buttons. By pressing the ENTER in any text box submits the form. So i want to disable the pressing enter only in text boxes and to enable in text-...

I have a form with multiple TextBoxes, Textarea and Buttons. By pressing the ENTER in any text box submits the form. So i want to disable the pressing enter only in text boxes and to enable in text-...

  1. disable enter submit form
  2. disable enter submit form angular
  3. disable enter submit form javascript
  4. disable enter submit form jquery
  5. disable enter submit
  6. disable enter submit form html
  7. disable enter submit jquery
  8. disable enter submit form react
  9. disable enter submit form asp.net
  10. disable enter submit angular
  11. disable submit enter key
  12. html disable enter submit
  13. disable enter key submit form
  14. input disable enter submit
  15. js disable enter submit
  16. formik disable enter submit
  17. javascript disable enter submit
  18. disable press enter submit form
  19. rails disable enter submit
  20. mvc disable enter submit

I am dealing with jQuery animation with infinite loop and my code is below: var width = $(document).width() - $('#mydiv').width(); $(document).ready(function() { function animateMydiv() { ...

I am dealing with jQuery animation with infinite loop and my code is below: var width = $(document).width() - $('#mydiv').width(); $(document).ready(function() { function animateMydiv() { ...

  1. create infinite loop python
  2. create infinite loop in c
  3. create infinite loop gif
  4. create infinite loop video
  5. create infinite loop javascript
  6. create infinite loop bash
  7. create infinite loop in java
  8. create infinite loop powershell
  9. create infinite loop
  10. create infinite loop batch file
  11. create infinite loop in jquery
  12. create infinite loop shell script
  13. create infinite loop linux
  14. create infinite loop in excel
  15. create infinite loop vba
  16. create infinite loop in php
  17. create infinite loop in abap
  18. create infinite loop batch
  19. create infinite loop program
  20. create infinite folder loop

I have a javascript function which is supposed to behave differently when offline than online as a safeguard. I would like to have a Jasmine unit test which tests the function in both offline and ...

I have a javascript function which is supposed to behave differently when offline than online as a safeguard. I would like to have a Jasmine unit test which tests the function in both offline and ...

  1. how to fake being offline