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

22nd
Aug 2017
Andreas Gies
@atooni
Aug 22 2017 12:01
Hello, if I am not mistaken the ReactTable does not support selecting one or more table entries at the moment. Would that be something to put into a PR ?
BTW. The components work nicely in ScalaJS React 1.1.0 based on the open pull request
Roberto Leibman
@rleibman
Aug 22 2017 15:39
@atooni I have a PR for a mostly complete rewrite of a parametrized ReactTable, but I'm waiting for the 1.1.0 stuff to go live before I get that through... what do you mean by one or more table entries?
Andreas Gies
@atooni
Aug 22 2017 17:44
@rleibman That sounds good. Basically I was looking for a table component where I can select one or more entries from the table. In our application (a management console) we would use such a component to select the containers we want to deploy to.
Andreas Gies
@atooni
Aug 22 2017 17:53
@rleibman - just looking at your fork and the ReactTable. What do you mean by parametrized table ? - I am looking at your scalajs-react-1.0.0 branch
Roberto Leibman
@rleibman
Aug 22 2017 18:48
I haven't pushed it yet, I have it local... basically you'll have a ReactTable[MyObject] and have renderers for each cell that pass your object to it.
Andreas Gies
@atooni
Aug 22 2017 18:48
Ok, I see
I am just studying the code to get my head around where would be a good starting point adding the selection behavior
Roberto Leibman
@rleibman
Aug 22 2017 18:49
After I check that in, I'd like to make it do server paging.
... lemme think. You could always add one column that's a check box, and add "select all", "clear all" buttons at the top and bottom.
Andreas Gies
@atooni
Aug 22 2017 18:50
yes, that was what i was thinking
Along the lines of making "selectable" a boolean property defaulting to false
if turned on you would see the checkboxes. Another property "multiselection" would allow multiple rows to be selected when true, otherwise only one
perhaps the selectAll should be configurable as well
I have checked out the code based on https://github.com/fmcgough/scalajs-react-components for now and have run it against Scala JS React 1.1.0
Roberto Leibman
@rleibman
Aug 22 2017 18:53
Maybe you don't need the checkboxes.
You can have the selection status be represented in a different color or shade, similar to semantic-ui's table.
Andreas Gies
@atooni
Aug 22 2017 18:54
yes, in that case i would need a selected style
Also... the MUITable seems to allow multi-selection.
Andreas Gies
@atooni
Aug 22 2017 18:55
Yes, I have seen that.
Roberto Leibman
@rleibman
Aug 22 2017 18:55
But it doesn't have paging.
Andreas Gies
@atooni
Aug 22 2017 18:56
not out of the box
I spend a day reading and trying to figure out the best table I want to base on .... I am tending towards the Scala React Table with paging and add the selection piece
I am coming from backend development and am not familiar with all the components that might be out there
Roberto Leibman
@rleibman
Aug 22 2017 18:57
True. there's many ways we can go with this... you can expand the ReactTable to support more stuff, which sounds like fun, or we could create a new ReactTable that has Material components (or something similar) underlying it, giving us a lot of stuff "for free"
I like the idea of ReactTable as well, I think.
Andreas Gies
@atooni
Aug 22 2017 18:59
With that approach I can kind of imagine what I have to do. All the backend of our app is in Scala as well, so I am kind of on familiar ground .
I have wrapped another component wrapped - I am just looking at the examples to understand how to contribute that piece of work.
Just to get my head around the project - I guess I would stack that work on top of the open PR which is the adoption of scalajs react 1.1.0
Roberto Leibman
@rleibman
Aug 22 2017 19:02
Here's my current ReactTable:
Andreas Gies
@atooni
Aug 22 2017 19:06
Ok. I see you are now using a type parameter and proper mappings for the cells.
I like that
Roberto Leibman
@rleibman
Aug 22 2017 19:06
Exactly.
Andreas Gies
@atooni
Aug 22 2017 19:07
I am wondering if I should wait until everything is merged and then stack my changes on top
Roberto Leibman
@rleibman
Aug 22 2017 19:08
@oyvindberg How close are we to merging something for ReactJS 1.0.0?
And releasing?
Andreas Gies
@atooni
Aug 22 2017 19:10
Thx for your insights. I guess I will close the day with a bit of reading and wait for @oyvindberg s answer on the merging plans.
perhaps I ll get my hands dirty with the other component I was working on
Roberto Leibman
@rleibman
Aug 22 2017 19:12
I think he's on your side of the pond as well, so you might have better luck talking to him in your morning.
Andreas Gies
@atooni
Aug 22 2017 19:12
may be :)