These are chat archives for chandu0101/scalajs-react-components

20th
Mar 2018
elyphas
@elyphas
Mar 20 2018 15:22
@rleibman ; ah ok, thank you
elyphas
@elyphas
Mar 20 2018 16:54
@rleibman ; How can I do this: "put in the cells an editor" ??
Roberto Leibman
@rleibman
Mar 20 2018 17:19
@elyphas with React, you have to think your code in snapshots... all your code is always there, but what is rendered and what isn't depends on the state. One way of doing it is to have a field in your State called something like rowInEditMode. Then on your render method, your cell renderer would be something like if(rowInEditMode) <.input() else <.div()
Also, in your onItemClick (I think RenderTable has that, but if it doesn't, just add it to the cell renderer directly) you'd set the rowInEditMode field of the state.
elyphas
@elyphas
Mar 20 2018 19:05
@rleibman ; ahh thank you
Roberto Leibman
@rleibman
Mar 20 2018 19:55
It definitely is a different way of thinking and coding, it takes some getting used to.